[PATCH] Set page active bit in mincore() call.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]