[PATCH 0/3] staging: zcache: xcfmalloc support

Dave Hansen dave at linux.vnet.ibm.com
Thu Sep 1 16:54:47 UTC 2011


On Thu, 2011-09-01 at 11:33 -0500, Seth Jennings wrote:
> xcfmalloc is also 0(1) in that the number of freelists
> at that have to be checked is constant and not increasing
> with the number of allocations.  The constant hidden
> in the O(1) for finding a suitable block is NUM_FREELISTS.

The algorithm is technically O(n^2) since there are
XCF_MAX_BLOCKS_PER_ALLOC searches through XCF_NUM_FREELISTS.  There's
also the reserved pages refill loop, which is linear too.

xcfmalloc's big compromise is that it doesn't do any searching or
fitting.  It might needlessly split larger blocks when two small ones
would have worked, for instance.

-- Dave




More information about the devel mailing list