linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: Pavel Emelyanov <xemul@parallels.com>
Cc: Linux MM <linux-mm@kvack.org>, Hugh Dickins <hughd@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH 3/3] mincore: Introduce the MINCORE_SWAP bit
Date: Mon, 26 Dec 2011 12:08:46 +0400	[thread overview]
Message-ID: <4EF82B8E.5050609@openvz.org> (raw)
In-Reply-To: <4EF78BAB.9030508@parallels.com>

Pavel Emelyanov wrote:
> 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.

We can reuse ANON bit there.
Plus you forget to handle migration-entries, they can be both file and anon too.

>
> 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;

--
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>

      reply	other threads:[~2011-12-26  8:08 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 ` [PATCH 3/3] mincore: Introduce the MINCORE_SWAP bit Pavel Emelyanov
2011-12-26  8:08   ` Konstantin Khlebnikov [this message]

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=4EF82B8E.5050609@openvz.org \
    --to=khlebnikov@openvz.org \
    --cc=aarcange@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=xemul@parallels.com \
    /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