Commit 584208e6b4103d2cfb08a7889c9fa3540826e0d5

Authored by Daniel Kiper
Committed by Linus Torvalds
1 parent 67954fe957

mm: optimize pfn calculation in online_page()

If CONFIG_FLATMEM is enabled pfn is calculated in online_page() more than
once.  It is possible to optimize that and use value established at
beginning of that function.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Acked-by: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <cl@linux.com>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

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

... ... @@ -375,7 +375,7 @@
375 375 #endif
376 376  
377 377 #ifdef CONFIG_FLATMEM
378   - max_mapnr = max(page_to_pfn(page), max_mapnr);
  378 + max_mapnr = max(pfn, max_mapnr);
379 379 #endif
380 380  
381 381 ClearPageReserved(page);