• Christoph Lameter's avatar
    [PATCH] Get rid of zone_table[] · 89689ae7
    Christoph Lameter authored
    The zone table is mostly not needed.  If we have a node in the page flags
    then we can get to the zone via NODE_DATA() which is much more likely to be
    already in the cpu cache.
    In case of SMP and UP NODE_DATA() is a constant pointer which allows us to
    access an exact replica of zonetable in the node_zones field.  In all of
    the above cases there will be no need at all for the zone table.
    The only remaining case is if in a NUMA system the node numbers do not fit
    into the page flags.  In that case we make sparse generate a table that
    maps sections to nodes and use that table to to figure out the node number.
     This table is sized to fit in a single cache line for the known 32 bit
    NUMA platform which makes it very likely that the information can be
    obtained without a cache miss.
    For sparsemem the zone table seems to be have been fairly large based on
    the maximum possible number of sections and the number of zones per node.
    There is some memory saving by removing zone_table.  The main benefit is to
    reduce the cache foootprint of the VM from the frequent lookups of zones.
    Plus it simplifies the page allocator.
    [akpm@osdl.org: build fix]
    Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
    Cc: Dave Hansen <haveblue@us.ibm.com>
    Cc: Andy Whitcroft <apw@shadowen.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
page_alloc.c 82.8 KB