mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
mm, memory hotplug: small cleanup in online_pages()
We can reuse the nid we've determined instead of repeated pfn_to_nid() usages. Also zone_to_nid() should be a bit cheaper in general than pfn_to_nid(). Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Cc: Rik van Riel <riel@redhat.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: David Rientjes <rientjes@google.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
698b1b3064
commit
e888ca3545
1 changed files with 3 additions and 3 deletions
|
@ -1055,7 +1055,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
|
||||||
arg.nr_pages = nr_pages;
|
arg.nr_pages = nr_pages;
|
||||||
node_states_check_changes_online(nr_pages, zone, &arg);
|
node_states_check_changes_online(nr_pages, zone, &arg);
|
||||||
|
|
||||||
nid = pfn_to_nid(pfn);
|
nid = zone_to_nid(zone);
|
||||||
|
|
||||||
ret = memory_notify(MEM_GOING_ONLINE, &arg);
|
ret = memory_notify(MEM_GOING_ONLINE, &arg);
|
||||||
ret = notifier_to_errno(ret);
|
ret = notifier_to_errno(ret);
|
||||||
|
@ -1095,7 +1095,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
|
||||||
pgdat_resize_unlock(zone->zone_pgdat, &flags);
|
pgdat_resize_unlock(zone->zone_pgdat, &flags);
|
||||||
|
|
||||||
if (onlined_pages) {
|
if (onlined_pages) {
|
||||||
node_states_set_node(zone_to_nid(zone), &arg);
|
node_states_set_node(nid, &arg);
|
||||||
if (need_zonelists_rebuild)
|
if (need_zonelists_rebuild)
|
||||||
build_all_zonelists(NULL, NULL);
|
build_all_zonelists(NULL, NULL);
|
||||||
else
|
else
|
||||||
|
@ -1107,7 +1107,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
|
||||||
init_per_zone_wmark_min();
|
init_per_zone_wmark_min();
|
||||||
|
|
||||||
if (onlined_pages) {
|
if (onlined_pages) {
|
||||||
kswapd_run(zone_to_nid(zone));
|
kswapd_run(nid);
|
||||||
kcompactd_run(nid);
|
kcompactd_run(nid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue