summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kiper <dkiper@net-space.pl>2011-04-14 15:21:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-14 16:06:54 -0700
commit584208e6b4103d2cfb08a7889c9fa3540826e0d5 (patch)
tree0333330823c7bc82d73ea1506a5f35555bd577ef
parent67954fe95705a8ff80335964bd7e621d13fbc499 (diff)
downloadop-kernel-dev-584208e6b4103d2cfb08a7889c9fa3540826e0d5.zip
op-kernel-dev-584208e6b4103d2cfb08a7889c9fa3540826e0d5.tar.gz
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>
-rw-r--r--mm/memory_hotplug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index a2acaf8..9ca1d60 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -375,7 +375,7 @@ void online_page(struct page *page)
#endif
#ifdef CONFIG_FLATMEM
- max_mapnr = max(page_to_pfn(page), max_mapnr);
+ max_mapnr = max(pfn, max_mapnr);
#endif
ClearPageReserved(page);
OpenPOWER on IntegriCloud