Skip to content

Commit 2f7f24e

Browse files
Kent Liutorvalds
authored andcommitted
memory-hotplug: don't calculate vm_total_pages twice when rebuilding zonelists in online_pages()
If zonelist is required to be rebuilt in online_pages(), there is no need to recalculate vm_total_pages in that function, as it has been updated in the call build_all_zonelists(). Signed-off-by: Kent Liu <[email protected]> Acked-by: KAMEZAWA Hiroyuki <[email protected]> Cc: Yasunori Goto <[email protected]> Cc: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent af370fb commit 2f7f24e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mm/memory_hotplug.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
429429

430430
if (need_zonelists_rebuild)
431431
build_all_zonelists();
432-
vm_total_pages = nr_free_pagecache_pages();
432+
else
433+
vm_total_pages = nr_free_pagecache_pages();
434+
433435
writeback_set_ratelimit();
434436

435437
if (onlined_pages)

0 commit comments

Comments
 (0)