• Dave Hansen's avatar
    [PATCH] stop using "base" argument in __free_pages_bulk() · 6f2584c3
    Dave Hansen authored
    Appended is a patch which stops using the zone->zone_mem_map to calculate
    the buddy and combined page pointers.  It uses the fact that the mem_map
    array is guaranteed to be contigious for the surrounding (1 << MAX_ORDER)
    pages.  The relative positions of the pages in the physical address space
    to provide the alignement; which conicidentally fixes the issue where zones
    are not aligned at MAX_ORDER.  There is a very comprehensive comment in the
    new code explaining the mathematical relationship between a page and its
    buddy so I won't reproduce it here.
    
    This kind of approach is required for CONFIG_NONLINEAR systems where the
    mem_map is not contiguous within a zone, and the zone->zone_mem_map is not
    used at all.
    
    This patch has been boot-tested on a large variety of systems and
    architectures: my P4 laptop, 16-way NUMAQ, 16-way Summit, 4-way x86 SMP,
    ppc64 LPAR, x86_64, and several ia64 configurations.
    
    It has been performance-tested on a 16-way NUMAQ.  SDET shows a very slight
    (within margin of error) performance gain.  Kernbench shows an
    approximately ~1% decrease in system time with this patch applied.  So, it
    has a likely positive performance impact.
    
    However, the patch has the potential to have a negative performance impact
    on systems with an expensive page_to_pfn() implementation.  But, I think
    the NUMAQ has one of the more expensive ones around, and it doesn't seem
    mind too much.
    Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
    Signed-off-by: default avatarDave Hansen <haveblue@us.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    6f2584c3
page_alloc.c 53.6 KB