diff options
author | Michal Hocko <mhocko@suse.com> | 2017-09-06 19:20:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-06 20:27:25 -0400 |
commit | 72675e131eb418c78980c1e683c0c25a25b61221 (patch) | |
tree | 51e1986b2309e21e317c53ee00cebad5de443502 /mm/page_alloc.c | |
parent | d9c9a0b9729c35c96ef7bee4ded56d9441bebd58 (diff) |
mm, memory_hotplug: drop zone from build_all_zonelists
build_all_zonelists gets a zone parameter to initialize zone's pagesets.
There is only a single user which gives a non-NULL zone parameter and
that one doesn't really need the rest of the build_all_zonelists (see
commit 6dcd73d7011b ("memory-hotplug: allocate zone's pcp before
onlining pages")).
Therefore remove setup_zone_pageset from build_all_zonelists and call it
from its only user directly. This will also remove a pointless zonlists
rebuilding which is always good.
Link: http://lkml.kernel.org/r/20170721143915.14161-5-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Shaohua Li <shaohua.li@intel.com>
Cc: Toshi Kani <toshi.kani@hpe.com>
Cc: Wen Congyang <wency@cn.fujitsu.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 | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 94fb4370e000..2523d5b3b22f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -5129,7 +5129,6 @@ static void build_zonelists(pg_data_t *pgdat) | |||
5129 | static void setup_pageset(struct per_cpu_pageset *p, unsigned long batch); | 5129 | static void setup_pageset(struct per_cpu_pageset *p, unsigned long batch); |
5130 | static DEFINE_PER_CPU(struct per_cpu_pageset, boot_pageset); | 5130 | static DEFINE_PER_CPU(struct per_cpu_pageset, boot_pageset); |
5131 | static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); | 5131 | static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); |
5132 | static void setup_zone_pageset(struct zone *zone); | ||
5133 | 5132 | ||
5134 | /* | 5133 | /* |
5135 | * Global mutex to protect against size modification of zonelists | 5134 | * Global mutex to protect against size modification of zonelists |
@@ -5209,20 +5208,14 @@ build_all_zonelists_init(void) | |||
5209 | * Called with zonelists_mutex held always | 5208 | * Called with zonelists_mutex held always |
5210 | * unless system_state == SYSTEM_BOOTING. | 5209 | * unless system_state == SYSTEM_BOOTING. |
5211 | * | 5210 | * |
5212 | * __ref due to (1) call of __meminit annotated setup_zone_pageset | 5211 | * __ref due to call of __init annotated helper build_all_zonelists_init |
5213 | * [we're only called with non-NULL zone through __meminit paths] and | ||
5214 | * (2) call of __init annotated helper build_all_zonelists_init | ||
5215 | * [protected by SYSTEM_BOOTING]. | 5212 | * [protected by SYSTEM_BOOTING]. |
5216 | */ | 5213 | */ |
5217 | void __ref build_all_zonelists(pg_data_t *pgdat, struct zone *zone) | 5214 | void __ref build_all_zonelists(pg_data_t *pgdat) |
5218 | { | 5215 | { |
5219 | if (system_state == SYSTEM_BOOTING) { | 5216 | if (system_state == SYSTEM_BOOTING) { |
5220 | build_all_zonelists_init(); | 5217 | build_all_zonelists_init(); |
5221 | } else { | 5218 | } else { |
5222 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
5223 | if (zone) | ||
5224 | setup_zone_pageset(zone); | ||
5225 | #endif | ||
5226 | /* we have to stop all cpus to guarantee there is no user | 5219 | /* we have to stop all cpus to guarantee there is no user |
5227 | of zonelist */ | 5220 | of zonelist */ |
5228 | stop_machine_cpuslocked(__build_all_zonelists, pgdat, NULL); | 5221 | stop_machine_cpuslocked(__build_all_zonelists, pgdat, NULL); |
@@ -5496,7 +5489,7 @@ static void __meminit zone_pageset_init(struct zone *zone, int cpu) | |||
5496 | pageset_set_high_and_batch(zone, pcp); | 5489 | pageset_set_high_and_batch(zone, pcp); |
5497 | } | 5490 | } |
5498 | 5491 | ||
5499 | static void __meminit setup_zone_pageset(struct zone *zone) | 5492 | void __meminit setup_zone_pageset(struct zone *zone) |
5500 | { | 5493 | { |
5501 | int cpu; | 5494 | int cpu; |
5502 | zone->pageset = alloc_percpu(struct per_cpu_pageset); | 5495 | zone->pageset = alloc_percpu(struct per_cpu_pageset); |