Commit 2f7f24eca31c4fc2fdb134b2ef743ccd67cfb9a9

Authored by Kent Liu
Committed by Linus Torvalds
1 parent af370fb8cb

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 <kent.liu@linux.intel.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

... ... @@ -429,7 +429,9 @@
429 429  
430 430 if (need_zonelists_rebuild)
431 431 build_all_zonelists();
432   - vm_total_pages = nr_free_pagecache_pages();
  432 + else
  433 + vm_total_pages = nr_free_pagecache_pages();
  434 +
433 435 writeback_set_ratelimit();
434 436  
435 437 if (onlined_pages)