• Andy Whitcroft's avatar
    [PATCH] fix GFP zone modifier interators · 9e19e93b
    Andy Whitcroft authored
    For each node there are a defined list of MAX_NR_ZONES zones.  These are
    selected as a result of the __GFP_DMA and __GFP_HIGHMEM zone modifier flags
    being passed to the memory allocator as part of the GFP mask.  Each node
    has a set of zone lists, node_zonelists, which defines the list and order
    of zones to scan for each flag combination.  When initialising these lists
    we iterate over modifier combinations 0 ..  MAX_NR_ZONES.  However, this is
    only correct when there are at most ZONES_SHIFT flags.  If another flag is
    introduced zonelists for it would not be initialised.
    
    This patch introduces GFP_ZONETYPES (based on GFP_ZONEMASK) as a bound for
    the number of modifier combinations.
    Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    9e19e93b
page_alloc.c 50.3 KB