From: Lee Schermerhorn Move recording of nodes w/ cpus to before zone loop. Otherwise, error exit could skip setup of N_CPU mask. Signed-off-by: Lee Schermerhorn Cc: Christoph Lameter Cc: Bob Picco Cc: Nishanth Aravamudan Cc: KAMEZAWA Hiroyuki Cc: Mel Gorman Signed-off-by: Andrew Morton --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN mm/page_alloc.c~memoryless-nodes-add-n_cpu-node-state-move-setup-of-n_cpu-node-state-mask mm/page_alloc.c --- a/mm/page_alloc.c~memoryless-nodes-add-n_cpu-node-state-move-setup-of-n_cpu-node-state-mask +++ a/mm/page_alloc.c @@ -2355,6 +2355,8 @@ static int __cpuinit process_zones(int c struct zone *zone, *dzone; int node = cpu_to_node(cpu); + node_set_state(node, N_CPU); /* this node has a cpu */ + for_each_zone(zone) { if (!populated_zone(zone)) @@ -2372,7 +2374,6 @@ static int __cpuinit process_zones(int c (zone->present_pages / percpu_pagelist_fraction)); } - node_set_state(node, N_CPU); return 0; bad: for_each_zone(dzone) { _