diff options
author | Michal Hocko <mhocko@suse.com> | 2017-09-06 19:20:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-06 20:27:25 -0400 |
commit | afb6ebb3faeb382f7c8b4478f2a84cee37bb8610 (patch) | |
tree | f37b6eb6cab9a0957b682d21a22fc46818c90e93 /mm/page_alloc.c | |
parent | c9bff3eebc09be23fbc868f5e6731666d23cbea3 (diff) |
mm, page_alloc: remove boot pageset initialization from memory hotplug
boot_pageset is a boot time hack which gets superseded by normal
pagesets later in the boot process. It makes zero sense to reinitialize
it again and again during memory hotplug.
Link: http://lkml.kernel.org/r/20170721143915.14161-3-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 | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6b23df1be909..94e64784a8be 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5141,7 +5141,7 @@ DEFINE_MUTEX(zonelists_mutex); | |||
5141 | static int __build_all_zonelists(void *data) | 5141 | static int __build_all_zonelists(void *data) |
5142 | { | 5142 | { |
5143 | int nid; | 5143 | int nid; |
5144 | int cpu; | 5144 | int __maybe_unused cpu; |
5145 | pg_data_t *self = data; | 5145 | pg_data_t *self = data; |
5146 | 5146 | ||
5147 | #ifdef CONFIG_NUMA | 5147 | #ifdef CONFIG_NUMA |
@@ -5162,23 +5162,8 @@ static int __build_all_zonelists(void *data) | |||
5162 | } | 5162 | } |
5163 | } | 5163 | } |
5164 | 5164 | ||
5165 | /* | ||
5166 | * Initialize the boot_pagesets that are going to be used | ||
5167 | * for bootstrapping processors. The real pagesets for | ||
5168 | * each zone will be allocated later when the per cpu | ||
5169 | * allocator is available. | ||
5170 | * | ||
5171 | * boot_pagesets are used also for bootstrapping offline | ||
5172 | * cpus if the system is already booted because the pagesets | ||
5173 | * are needed to initialize allocators on a specific cpu too. | ||
5174 | * F.e. the percpu allocator needs the page allocator which | ||
5175 | * needs the percpu allocator in order to allocate its pagesets | ||
5176 | * (a chicken-egg dilemma). | ||
5177 | */ | ||
5178 | for_each_possible_cpu(cpu) { | ||
5179 | setup_pageset(&per_cpu(boot_pageset, cpu), 0); | ||
5180 | |||
5181 | #ifdef CONFIG_HAVE_MEMORYLESS_NODES | 5165 | #ifdef CONFIG_HAVE_MEMORYLESS_NODES |
5166 | for_each_possible_cpu(cpu) { | ||
5182 | /* | 5167 | /* |
5183 | * We now know the "local memory node" for each node-- | 5168 | * We now know the "local memory node" for each node-- |
5184 | * i.e., the node of the first zone in the generic zonelist. | 5169 | * i.e., the node of the first zone in the generic zonelist. |
@@ -5189,8 +5174,8 @@ static int __build_all_zonelists(void *data) | |||
5189 | */ | 5174 | */ |
5190 | if (cpu_online(cpu)) | 5175 | if (cpu_online(cpu)) |
5191 | set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu))); | 5176 | set_cpu_numa_mem(cpu, local_memory_node(cpu_to_node(cpu))); |
5192 | #endif | ||
5193 | } | 5177 | } |
5178 | #endif | ||
5194 | 5179 | ||
5195 | return 0; | 5180 | return 0; |
5196 | } | 5181 | } |
@@ -5198,7 +5183,26 @@ static int __build_all_zonelists(void *data) | |||
5198 | static noinline void __init | 5183 | static noinline void __init |
5199 | build_all_zonelists_init(void) | 5184 | build_all_zonelists_init(void) |
5200 | { | 5185 | { |
5186 | int cpu; | ||
5187 | |||
5201 | __build_all_zonelists(NULL); | 5188 | __build_all_zonelists(NULL); |
5189 | |||
5190 | /* | ||
5191 | * Initialize the boot_pagesets that are going to be used | ||
5192 | * for bootstrapping processors. The real pagesets for | ||
5193 | * each zone will be allocated later when the per cpu | ||
5194 | * allocator is available. | ||
5195 | * | ||
5196 | * boot_pagesets are used also for bootstrapping offline | ||
5197 | * cpus if the system is already booted because the pagesets | ||
5198 | * are needed to initialize allocators on a specific cpu too. | ||
5199 | * F.e. the percpu allocator needs the page allocator which | ||
5200 | * needs the percpu allocator in order to allocate its pagesets | ||
5201 | * (a chicken-egg dilemma). | ||
5202 | */ | ||
5203 | for_each_possible_cpu(cpu) | ||
5204 | setup_pageset(&per_cpu(boot_pageset, cpu), 0); | ||
5205 | |||
5202 | mminit_verify_zonelist(); | 5206 | mminit_verify_zonelist(); |
5203 | cpuset_init_current_mems_allowed(); | 5207 | cpuset_init_current_mems_allowed(); |
5204 | } | 5208 | } |