linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Set page active bit in mincore() call.
@ 2012-09-17 16:05 Roman Guschin
  0 siblings, 0 replies; only message in thread
From: Roman Guschin @ 2012-09-17 16:05 UTC (permalink / raw)
  To: linux-mm

Hi all!

It's a very simple patch that allows to see which pages are active and
which not.
It's very useful for debugging performance issues in mm.
I used the vmtouch tool (with a simple modification) to display the results.

R.

---
 mm/mincore.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/mm/mincore.c b/mm/mincore.c
index 7c2874a..31301d2 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -61,7 +61,7 @@ static void mincore_hugetlb_page_range(struct
vm_area_struct *vma,
  */
 static unsigned char mincore_page(struct address_space *mapping, pgoff_t pgoff)
 {
-	unsigned char present = 0;
+	unsigned char flags = 0;
 	struct page *page;

 	/*
@@ -79,13 +79,15 @@ static unsigned char mincore_page(struct
address_space *mapping, pgoff_t pgoff)
 	}
 #endif
 	if (page) {
-		present = PageUptodate(page);
-		if (present)
-			present |= (PageReadaheadUnused(page) << 7);
+		flags = PageUptodate(page);
+		if (flags) {
+			flags |= (PageActive(page) << 1);
+			flags |= (PageReadaheadUnused(page) << 7);
+		}
 		page_cache_release(page);
 	}

-	return present;
+	return flags;
 }

 static void mincore_unmapped_range(struct vm_area_struct *vma,
--

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-17 16:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-17 16:05 [PATCH] Set page active bit in mincore() call Roman Guschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox