Daniel Kiper
2011-Mar-28 09:23 UTC
[Xen-devel] [PATCH 1/3] 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> --- mm/memory_hotplug.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 321fc74..f0651ae 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); -- 1.5.6.5 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dave Hansen
2011-Mar-28 15:24 UTC
[Xen-devel] Re: [PATCH 1/3] mm: Optimize pfn calculation in online_page()
On Mon, 2011-03-28 at 11:23 +0200, Daniel Kiper wrote:> 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>Looks sensible to me. Acked-by: Dave Hansen <dave@linux.vnet.ibm.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
David Rientjes
2011-Mar-28 22:41 UTC
[Xen-devel] Re: [PATCH 1/3] mm: Optimize pfn calculation in online_page()
On Mon, 28 Mar 2011, Daniel Kiper wrote:> 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: David Rientjes <rientjes@google.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jesper Juhl
2011-Mar-28 22:44 UTC
[Xen-devel] Re: [PATCH 1/3] mm: Optimize pfn calculation in online_page()
On Mon, 28 Mar 2011, Daniel Kiper wrote:> 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>This looks sane to me. Reviewed-by: Jesper Juhl <jj@chaosbits.net> -- Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/ Don''t top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, please. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel