From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail172.messagelabs.com (mail172.messagelabs.com [216.82.254.3]) by kanga.kvack.org (Postfix) with SMTP id 3211860021B for ; Mon, 28 Dec 2009 05:00:59 -0500 (EST) Received: by mail-yw0-f175.google.com with SMTP id 5so14494918ywh.11 for ; Mon, 28 Dec 2009 02:00:56 -0800 (PST) From: Minchan Kim Subject: [PATCH 3/3 -mmotm-2009-12-10-17-19] Fix wrong rss counting of smap Date: Sat, 21 Nov 2009 12:24:20 +0900 Message-Id: In-Reply-To: References: In-Reply-To: References: Sender: owner-linux-mm@kvack.org To: Andrew Morton , LKML , linux-mm Cc: Minchan Kim , KAMEZAWA Hiroyuki List-ID: 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 --- 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; -- 1.5.6.5 -- 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: email@kvack.org