2011-03-28 09:23:49

by Daniel Kiper

[permalink] [raw]
Subject: [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 <[email protected]>
---
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


2011-03-28 15:24:25

by Dave Hansen

[permalink] [raw]
Subject: 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 <[email protected]>

Looks sensible to me.

Acked-by: Dave Hansen <[email protected]

2011-03-28 22:42:02

by David Rientjes

[permalink] [raw]
Subject: 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 <[email protected]>

Acked-by: David Rientjes <[email protected]>

2011-03-28 22:44:39

by Jesper Juhl

[permalink] [raw]
Subject: 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 <[email protected]>

This looks sane to me.

Reviewed-by: Jesper Juhl <[email protected]>


--
Jesper Juhl <[email protected]> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.