Re: [PATCH]Fix parsing kernelcore boot option for ia64

From: Mel Gorman
Date: Tue Apr 24 2007 - 06:09:55 EST


On Tue, 24 Apr 2007, Yasunori Goto wrote:



Subject: Check zone boundaries when freeing bootmem
Zone boundaries do not have to be aligned to MAX_ORDER_NR_PAGES.

Hmm. I don't understand here yet... Could you explain more?


Nodes are required to be MAX_ORDER_NR_PAGES aligned for the buddy algorithm to work but zones can be at any alignment because the page_is_buddy() check checks the zone_id of two buddies when merging. As zones are generally aligned anyway, it was never noticed that the bootmem allocators assumes zones are at least order-5 aligned on 32 bit and order-6 aligned on 64 bit.

This issue occurs only when ZONE_MOVABLE is specified.

Yes, because it can be sized to any value. At the moment, zones are aligned to MAX_ORDER_NR_PAGES so it was not noticed that bootmem makes assumptions on zone alignment.

If its boundary is aligned to MAX_ORDER automatically,
I guess user will not mind it.


Probably not. They will get a different amount of memory usable by the kernel than they asked for but it doesn't really matter. Huge pages generally need MAX_ORDER_NR_PAGES base pages as well so the alignment doesn't hurt there.

From memory hotplug view, I prefer section size alignment to make
simple code. :-P


That's fair. I'll roll up a patch that aligns to MAX_ORDER_NR_PAGES to begin with and then decide if it should align to section size on SPARSEMEM or not.


However,
during boot, there is an implicit assumption that they are aligned to a
BITS_PER_LONG boundary when freeing pages as quickly as possible. This
patch checks the zone boundaries when freeing pages from the bootmem allocator.

Anyway, the patch works well.


Right, I'll resend it to linux-mm as a standalone patch later so because it fixes a correctness issue albeit one that is easily avoided.

Bye.


Thanks

--
Mel Gorman
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab
-
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/