[PATCH 1/4] Memory Add Fixes for ppc64

Andy Whitcroft apw at shadowen.org
Wed Nov 9 01:51:55 EST 2005


Mike Kravetz wrote:

> Just curious if we still want to boost MAX_ORDER like this with 64k
> pages?  Doesn't that make the MAX_ORDER block size 256MB in this case?
> Also, not quite sure what happens if memory size (a 16 MB multiple)
> does not align with a MAX_ORDER block size (a 256MB multiple in this
> case).  My 'guess' is that the page allocator would not use it as it
> would not fit within the buddy system.

The buddy system and the SPARSEMEM mem_map are separate really.  The key
limitation is the a MAX_ORDER chunk must fit within the SPARSEMEM block
size it cannot span two blocks.  This is because the algorithm by which
the buddy system finds buddies for a returning allocation assumes that
mem_map is contigious upto the maximum buddy size (MAX_ORDER); it
assumes it can use relative addressing to locate them.

The buddy system doesn't really care about the alignment of any of its
blocks.  The allocator is built empty and all existant pages are freed
back to it.  If there is a chunk of memory which can never coalesce back
to MAX_ORDER it will simply sit lower in the tree 'waiting' for these
non-existant buddies and will never merge.  It will still be usable.

-apw



More information about the Linuxppc64-dev mailing list