]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm, numa: reclaim from all nodes within reclaim distance fix fix
authorDavid Rientjes <rientjes@google.com>
Fri, 28 Sep 2012 00:19:55 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Sep 2012 06:07:53 +0000 (16:07 +1000)
It's cleaner if the iteration is explicitly done only for NUMA kernels.
No functional change.

Intended to be folded into
mm-numa-reclaim-from-all-nodes-within-reclaim-distance.patch already in
-mm.

Signed-off-by: David 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: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index e6b99adf7d157731970d144173a0c8a006e31987..eac9c181d6bea400f5ea911f6dacb0493417cef5 100644 (file)
@@ -1803,6 +1803,17 @@ static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone)
        return node_isset(local_zone->node, zone->zone_pgdat->reclaim_nodes);
 }
 
+static void __paginginit init_zone_allows_reclaim(int nid)
+{
+       int i;
+
+       for_each_online_node(i)
+               if (node_distance(nid, i) <= RECLAIM_DISTANCE) {
+                       node_set(i, NODE_DATA(nid)->reclaim_nodes);
+                       zone_reclaim_mode = 1;
+               }
+}
+
 #else  /* CONFIG_NUMA */
 
 static nodemask_t *zlc_setup(struct zonelist *zonelist, int alloc_flags)
@@ -1828,6 +1839,10 @@ static bool zone_allows_reclaim(struct zone *local_zone, struct zone *zone)
 {
        return true;
 }
+
+static inline void init_zone_allows_reclaim(int nid)
+{
+}
 #endif /* CONFIG_NUMA */
 
 /*
@@ -4548,20 +4563,13 @@ void __paginginit free_area_init_node(int nid, unsigned long *zones_size,
                unsigned long node_start_pfn, unsigned long *zholes_size)
 {
        pg_data_t *pgdat = NODE_DATA(nid);
-       int i;
 
        /* pg_data_t should be reset to zero when it's allocated */
        WARN_ON(pgdat->nr_zones || pgdat->classzone_idx);
 
        pgdat->node_id = nid;
        pgdat->node_start_pfn = node_start_pfn;
-       for_each_online_node(i)
-               if (node_distance(nid, i) <= RECLAIM_DISTANCE) {
-                       node_set(i, pgdat->reclaim_nodes);
-#ifdef CONFIG_NUMA
-                       zone_reclaim_mode = 1;
-#endif
-               }
+       init_zone_allows_reclaim(nid);
        calculate_node_totalpages(pgdat, zones_size, zholes_size);
 
        alloc_node_mem_map(pgdat);