From: Minchan Kim <minchan.kim@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
Matt Mackall <mpm@selenic.com>
Subject: Re: [PATCH 3/3 -mmotm-2009-12-10-17-19] Fix wrong rss counting of smap
Date: Mon, 28 Dec 2009 19:25:34 +0900 [thread overview]
Message-ID: <4B38879E.3060205@gmail.com> (raw)
In-Reply-To: <ff0a209159ef985681ae071d770edd9b9cd0ecf0.1258773030.git.minchan.kim@gmail.com>
I missed Hugn and Matt.
Minchan Kim wrote:
> After return zero_page, vm_normal_page can return
> NULL if the page is zero page.
>
> In such case, RSS and PSS can be mismatched.
> This patch fixes it.
>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> ---
> fs/proc/task_mmu.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 47c03f4..1a47be9 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -361,12 +361,11 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
> if (!pte_present(ptent))
> continue;
>
> - mss->resident += PAGE_SIZE;
> -
> page = vm_normal_page(vma, addr, ptent);
> - if (!page)
> + if (!page && !is_zero_pfn(pte_pfn(ptent)))
> continue;
>
> + mss->resident += PAGE_SIZE;
> /* Accumulate the size in pages that have been accessed. */
> if (pte_young(ptent) || PageReferenced(page))
> mss->referenced += PAGE_SIZE;
WARNING: multiple messages have this Message-ID (diff)
From: Minchan Kim <minchan.kim@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
Matt Mackall <mpm@selenic.com>
Subject: Re: [PATCH 3/3 -mmotm-2009-12-10-17-19] Fix wrong rss counting of smap
Date: Mon, 28 Dec 2009 19:25:34 +0900 [thread overview]
Message-ID: <4B38879E.3060205@gmail.com> (raw)
In-Reply-To: <ff0a209159ef985681ae071d770edd9b9cd0ecf0.1258773030.git.minchan.kim@gmail.com>
I missed Hugn and Matt.
Minchan Kim wrote:
> After return zero_page, vm_normal_page can return
> NULL if the page is zero page.
>
> In such case, RSS and PSS can be mismatched.
> This patch fixes it.
>
> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
> ---
> fs/proc/task_mmu.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 47c03f4..1a47be9 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -361,12 +361,11 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
> if (!pte_present(ptent))
> continue;
>
> - mss->resident += PAGE_SIZE;
> -
> page = vm_normal_page(vma, addr, ptent);
> - if (!page)
> + if (!page && !is_zero_pfn(pte_pfn(ptent)))
> continue;
>
> + mss->resident += PAGE_SIZE;
> /* Accumulate the size in pages that have been accessed. */
> if (pte_young(ptent) || PageReferenced(page))
> mss->referenced += PAGE_SIZE;
--
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>
next prev parent reply other threads:[~2009-12-28 10:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-21 3:24 [PATCH 1/3 -mmotm-2009-12-10-17-19] Move functions related to zero page Minchan Kim
2009-11-21 3:24 ` [PATCH 2/3 -mmotm-2009-12-10-17-19] Count zero page as file_rss Minchan Kim
2009-12-28 10:24 ` Minchan Kim
2009-12-28 10:24 ` Minchan Kim
2009-12-30 16:49 ` Hugh Dickins
2009-12-30 16:49 ` Hugh Dickins
2009-12-31 2:41 ` Minchan Kim
2009-12-31 2:41 ` Minchan Kim
2009-12-31 8:43 ` Hugh Dickins
2009-12-31 8:43 ` Hugh Dickins
2010-01-04 0:49 ` Minchan Kim
2010-01-04 0:49 ` Minchan Kim
2010-01-03 23:43 ` KAMEZAWA Hiroyuki
2010-01-03 23:43 ` KAMEZAWA Hiroyuki
2010-01-04 0:47 ` Minchan Kim
2010-01-04 0:47 ` Minchan Kim
2009-11-21 3:24 ` [PATCH 3/3 -mmotm-2009-12-10-17-19] Fix wrong rss counting of smap Minchan Kim
2009-12-28 10:25 ` Minchan Kim [this message]
2009-12-28 10:25 ` Minchan Kim
2009-12-28 10:23 ` [PATCH 1/3 -mmotm-2009-12-10-17-19] Move functions related to zero page Minchan Kim
2009-12-28 10:23 ` Minchan Kim
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=4B38879E.3060205@gmail.com \
--to=minchan.kim@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hugh.dickins@tiscali.co.uk \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.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 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.