From: Daniel Kiper Date: Thu, 14 Apr 2011 22:21:53 +0000 (-0700) Subject: mm: optimize pfn calculation in online_page() X-Git-Tag: v2.6.39-rc4~53 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=584208e6b4103d2cfb08a7889c9fa3540826e0d5 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 Acked-by: Dave Hansen Cc: KAMEZAWA Hiroyuki Cc: Wu Fengguang Cc: Mel Gorman Cc: Christoph Lameter Acked-by: David Rientjes Reviewed-by: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index a2acaf820fe5..9ca1d604f7cd 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);