diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 94e64784a8beaa..94fb4370e00068 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5160,10 +5160,8 @@ static int __build_all_zonelists(void *data) build_zonelists(pgdat); } - } #ifdef CONFIG_HAVE_MEMORYLESS_NODES - for_each_possible_cpu(cpu) { /* * We now know the "local memory node" for each node-- * i.e., the node of the first zone in the generic zonelist. @@ -5172,10 +5170,10 @@ static int __build_all_zonelists(void *data) * secondary cpus' numa_mem as they come on-line. During * node/memory hotplug, we'll fixup all on-line cpus. */ - if (cpu_online(cpu)) + for_each_online_cpu(cpu) set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu))); - } #endif + } return 0; }