Thread (36 messages) 36 messages, 5 authors, 2011-12-12

[PATCH 03/11] mm: mmzone: introduce zone_pfn_same_memmap()

From: Michal Nazarewicz <hidden>
Date: 2011-12-12 14:52:04
Also in: linux-media, linux-mm, lkml

On Fri, Nov 18, 2011 at 05:43:10PM +0100, Marek Szyprowski wrote:
quoted
From: Michal Nazarewicz <redacted>
diff --git a/mm/compaction.c b/mm/compaction.c
index 6afae0e..09c9702 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -111,7 +111,10 @@ skip:

 next:
 		pfn += isolated;
-		page += isolated;
+		if (zone_pfn_same_memmap(pfn - isolated, pfn))
+			page += isolated;
+		else
+			page = pfn_to_page(pfn);
 	}
On Mon, 12 Dec 2011 15:19:53 +0100, Mel Gorman [off-list ref] wrote:
Is this necessary?

We are isolating pages, the largest of which is a MAX_ORDER_NR_PAGES
page.  [...]
On Mon, 12 Dec 2011 15:40:30 +0100, Mel Gorman [off-list ref] wrote:
To be clear, I'm referring to a single page being isolated here. It may
or may not be a high-order page but it's still going to be less then
MAX_ORDER_NR_PAGES so you should be able check when a new block is
entered and pfn_to_page is necessary.
Do you mean something like:

if (same pageblock)
	just do arithmetic;
else
	use pfn_to_page;

?

I've discussed it with Dave and he suggested that approach as an
optimisation since in some configurations zone_pfn_same_memmap()
is always true thus compiler will strip the else part, whereas
same pageblock test will be false on occasions regardless of kernel
configuration.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Micha? ?mina86? Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help