Skip to content

Commit

Permalink
memory-hotplug: don't calculate vm_total_pages twice when rebuilding …
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
Kent Liu authored and torvalds committed Jul 24, 2008
1 parent af370fb commit 2f7f24e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,9 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)

if (need_zonelists_rebuild)
build_all_zonelists();
vm_total_pages = nr_free_pagecache_pages();
else
vm_total_pages = nr_free_pagecache_pages();

writeback_set_ratelimit();

if (onlined_pages)
Expand Down

0 comments on commit 2f7f24e

Please sign in to comment.