All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@parallels.com>
To: Linux MM <linux-mm@kvack.org>, Hugh Dickins <hughd@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: [PATCH 3/3] mincore: Introduce the MINCORE_SWAP bit
Date: Mon, 26 Dec 2011 00:46:35 +0400	[thread overview]
Message-ID: <4EF78BAB.9030508@parallels.com> (raw)
In-Reply-To: <4EF78B6A.8020904@parallels.com>

When a page is swapped out it should be included in the memory dump,
but the existing mincore() doesn't report the set bit for such pages.

Thus add a bit for swapped out pages.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>

---
 include/linux/mman.h |    1 +
 mm/mincore.c         |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/mman.h b/include/linux/mman.h
index 9d1de16..bfe4038 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -12,6 +12,7 @@
 
 #define MINCORE_RESIDENT	0x1
 #define MINCORE_ANON		0x2
+#define MINCORE_SWAP		0x4
 
 #ifdef __KERNEL__
 #include <linux/mm.h>
diff --git a/mm/mincore.c b/mm/mincore.c
index 3163dfb..82c5c3e 100644
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -146,7 +146,7 @@ static void mincore_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
 			} else {
 #ifdef CONFIG_SWAP
 				pgoff = entry.val;
-				*vec = mincore_page(&swapper_space, pgoff);
+				*vec = mincore_page(&swapper_space, pgoff) | MINCORE_SWAP;
 #else
 				WARN_ON(1);
 				*vec = MINCORE_RESIDENT;
-- 
1.5.5.6

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2011-12-25 20:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-25 20:45 [RFC][PATCH 0/3] Extend the mincore() report bits Pavel Emelyanov
2011-12-25 20:45 ` [PATCH 1/3] mincore: Introduce named constant for existing bit Pavel Emelyanov
2011-12-25 20:46 ` [PATCH 2/3] mincore: Introduce the MINCORE_ANON bit Pavel Emelyanov
2011-12-26  0:05   ` KOSAKI Motohiro
2011-12-26 16:07     ` Pavel Emelyanov
2011-12-26 16:35       ` KOSAKI Motohiro
2011-12-26 16:49         ` Pavel Emelyanov
2011-12-27 22:53           ` KOSAKI Motohiro
2011-12-25 20:46 ` Pavel Emelyanov [this message]
2011-12-26  8:08   ` [PATCH 3/3] mincore: Introduce the MINCORE_SWAP bit Konstantin Khlebnikov

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=4EF78BAB.9030508@parallels.com \
    --to=xemul@parallels.com \
    --cc=aarcange@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.