Re: [PATCH 2/3] xvmalloc memory allocator

From: Nitin Gupta
Date: Sat Mar 21 2009 - 13:37:34 EST


Pekka Enberg wrote:
On Sat, Mar 21, 2009 at 2:24 PM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
I assumed that you were referring to moving xvmalloc() down into
drivers/block. That would be bad, because then xvmalloc() will _never_ be
usable by anything other than ramzblock <new name!>?

Who is going to use it? The only reason compcache needs something
special is because it wants to take advantage of GFP_HIGHMEM pages.
Are there other subsystems that need this capability as well?


As I mentioned earlier, highmem is not the only advantage. Don't forget
O(1) alloc/free and low fragmentation. Sometime in next week, I will post
additional numbers comparing SLUB and xvmalloc.

One point I noted in SLUB is that, it needs to allocate higher order pages
to minimize space wastage at end of every page. For in-memory swap compression,
we simply cannot allocate higher order pages since its going to used under
memory crunch (its a swap device!) and we cannot hope to find lot of higher
order pages under such conditions. If we enforce it to use 0-order pages
then we cannot allocate > 2048b since all such allocations will end-up
using entire page!
Also, if we decide to use SLUB for objects of size < 2048b only then how will
we store bigger objects provided we can only use 0-order pages?
(we need storage for range, say, [32, 3/4*PAGE_SIZE]).

Nitin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/