linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roman Guschin <guroan@gmail.com>
To: linux-mm@kvack.org
Subject: [PATCH] Set page active bit in mincore() call.
Date: Mon, 17 Sep 2012 20:05:38 +0400	[thread overview]
Message-ID: <CALo0P118RQCNoUOv+WexDz9VLE6r-doFDUDFdZRuA=bOYL4xLQ@mail.gmail.com> (raw)

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>

                 reply	other threads:[~2012-09-17 16:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALo0P118RQCNoUOv+WexDz9VLE6r-doFDUDFdZRuA=bOYL4xLQ@mail.gmail.com' \
    --to=guroan@gmail.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox