• David Rientjes's avatar
    mm, numa: reclaim from all nodes within reclaim distance · 957f822a
    David Rientjes authored
    RECLAIM_DISTANCE represents the distance between nodes at which it is
    deemed too costly to allocate from; it's preferred to try to reclaim from
    a local zone before falling back to allocating on a remote node with such
    a distance.
    
    To do this, zone_reclaim_mode is set if the distance between any two
    nodes on the system is greather than this distance.  This, however, ends
    up causing the page allocator to reclaim from every zone regardless of
    its affinity.
    
    What we really want is to reclaim only from zones that are closer than
    RECLAIM_DISTANCE.  This patch adds a nodemask to each node that
    represents the set of nodes that are within this distance.  During the
    zone iteration, if the bit for a zone's node is set for the local node,
    then reclaim is attempted; otherwise, the zone is skipped.
    
    [akpm@linux-foundation.org: fix CONFIG_NUMA=n build]
    Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
    Cc: Mel Gorman <mgorman@suse.de>
    Cc: Minchan Kim <minchan@kernel.org>
    Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    957f822a
page_alloc.c 169 KB