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 6dcd73d701
("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>
This commit is contained in:

committed by
Linus Torvalds

parent
d9c9a0b972
commit
72675e131e
@@ -929,7 +929,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
|
||||
mutex_lock(&zonelists_mutex);
|
||||
if (!populated_zone(zone)) {
|
||||
need_zonelists_rebuild = 1;
|
||||
build_all_zonelists(NULL, zone);
|
||||
setup_zone_pageset(zone);
|
||||
}
|
||||
|
||||
ret = walk_system_ram_range(pfn, nr_pages, &onlined_pages,
|
||||
@@ -950,7 +950,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
|
||||
if (onlined_pages) {
|
||||
node_states_set_node(nid, &arg);
|
||||
if (need_zonelists_rebuild)
|
||||
build_all_zonelists(NULL, NULL);
|
||||
build_all_zonelists(NULL);
|
||||
else
|
||||
zone_pcp_update(zone);
|
||||
}
|
||||
@@ -1028,7 +1028,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
|
||||
* to access not-initialized zonelist, build here.
|
||||
*/
|
||||
mutex_lock(&zonelists_mutex);
|
||||
build_all_zonelists(pgdat, NULL);
|
||||
build_all_zonelists(pgdat);
|
||||
mutex_unlock(&zonelists_mutex);
|
||||
|
||||
/*
|
||||
@@ -1084,7 +1084,7 @@ int try_online_node(int nid)
|
||||
|
||||
if (pgdat->node_zonelists->_zonerefs->zone == NULL) {
|
||||
mutex_lock(&zonelists_mutex);
|
||||
build_all_zonelists(NULL, NULL);
|
||||
build_all_zonelists(NULL);
|
||||
mutex_unlock(&zonelists_mutex);
|
||||
}
|
||||
|
||||
@@ -1704,7 +1704,7 @@ repeat:
|
||||
if (!populated_zone(zone)) {
|
||||
zone_pcp_reset(zone);
|
||||
mutex_lock(&zonelists_mutex);
|
||||
build_all_zonelists(NULL, NULL);
|
||||
build_all_zonelists(NULL);
|
||||
mutex_unlock(&zonelists_mutex);
|
||||
} else
|
||||
zone_pcp_update(zone);
|
||||
|
Reference in New Issue
Block a user