diff options
author | Michal Hocko <mhocko@suse.com> | 2017-09-06 19:20:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-06 20:27:25 -0400 |
commit | d9c9a0b9729c35c96ef7bee4ded56d9441bebd58 (patch) | |
tree | 35f4cfc9b87e72b5a571af0be3fd49ec6012763d /mm/page_alloc.c | |
parent | afb6ebb3faeb382f7c8b4478f2a84cee37bb8610 (diff) |
mm, page_alloc: do not set_cpu_numa_mem on empty nodes initialization
__build_all_zonelists reinitializes each online cpu local node for
CONFIG_HAVE_MEMORYLESS_NODES. This makes sense because previously
memory less nodes could gain some memory during memory hotplug and so
the local node should be changed for CPUs close to such a node. It
makes less sense to do that unconditionally for a newly creaded NUMA
node which is still offline and without any memory.
Let's also simplify the cpu loop and use for_each_online_cpu instead of
an explicit cpu_online check for all possible cpus.
Link: http://lkml.kernel.org/r/20170721143915.14161-4-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Shaohua Li <shaohua.li@intel.com>
Cc: Toshi Kani <toshi.kani@hpe.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 94e64784a8be..94fb4370e000 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5160,10 +5160,8 @@ static int __build_all_zonelists(void *data) | |||
5160 | 5160 | ||
5161 | build_zonelists(pgdat); | 5161 | build_zonelists(pgdat); |
5162 | } | 5162 | } |
5163 | } | ||
5164 | 5163 | ||
5165 | #ifdef CONFIG_HAVE_MEMORYLESS_NODES | 5164 | #ifdef CONFIG_HAVE_MEMORYLESS_NODES |
5166 | for_each_possible_cpu(cpu) { | ||
5167 | /* | 5165 | /* |
5168 | * We now know the "local memory node" for each node-- | 5166 | * We now know the "local memory node" for each node-- |
5169 | * i.e., the node of the first zone in the generic zonelist. | 5167 | * i.e., the node of the first zone in the generic zonelist. |
@@ -5172,10 +5170,10 @@ static int __build_all_zonelists(void *data) | |||
5172 | * secondary cpus' numa_mem as they come on-line. During | 5170 | * secondary cpus' numa_mem as they come on-line. During |
5173 | * node/memory hotplug, we'll fixup all on-line cpus. | 5171 | * node/memory hotplug, we'll fixup all on-line cpus. |
5174 | */ | 5172 | */ |
5175 | if (cpu_online(cpu)) | 5173 | for_each_online_cpu(cpu) |
5176 | set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu))); | 5174 | set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu))); |
5177 | } | ||
5178 | #endif | 5175 | #endif |
5176 | } | ||
5179 | 5177 | ||
5180 | return 0; | 5178 | return 0; |
5181 | } | 5179 | } |