[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4B38879E.3060205@gmail.com>
Date: Mon, 28 Dec 2009 19:25:34 +0900
From: Minchan Kim <minchan.kim@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>
CC: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Hugh Dickins <hugh.dickins@...cali.co.uk>,
Matt Mackall <mpm@...enic.com>
Subject: Re: [PATCH 3/3 -mmotm-2009-12-10-17-19] Fix wrong rss counting of
smap
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@...il.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists