diff options
author | Minchan Kim <minchan.kim@gmail.com> | 2010-01-08 17:43:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-11 12:34:07 -0500 |
commit | 7f53a09ed40f08416b3029ada8f02252e7596c18 (patch) | |
tree | 51d2bef1ca3a4667e5b9058b6f2b365edd101ebd /fs/proc/task_mmu.c | |
parent | d2b34e20c1f431604e0dde910c3ff271c84ed706 (diff) |
smaps: fix wrong rss count
A long time ago we regarded zero page as file_rss and vm_normal_page
doesn't return NULL.
But now, we reinstated ZERO_PAGE and vm_normal_page's implementation can
return NULL in case of zero page. Also we don't count it with file_rss
any more.
Then, RSS and PSS can't be matched. For consistency, Let's ignore zero
page in smaps_pte_range.
Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Acked-by: Matt Mackall <mpm@selenic.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/task_mmu.c')
-rw-r--r-- | fs/proc/task_mmu.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 47c03f4336b8..f277c4a111cb 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, | |||
361 | if (!pte_present(ptent)) | 361 | if (!pte_present(ptent)) |
362 | continue; | 362 | continue; |
363 | 363 | ||
364 | mss->resident += PAGE_SIZE; | ||
365 | |||
366 | page = vm_normal_page(vma, addr, ptent); | 364 | page = vm_normal_page(vma, addr, ptent); |
367 | if (!page) | 365 | if (!page) |
368 | continue; | 366 | continue; |
369 | 367 | ||
368 | mss->resident += PAGE_SIZE; | ||
370 | /* Accumulate the size in pages that have been accessed. */ | 369 | /* Accumulate the size in pages that have been accessed. */ |
371 | if (pte_young(ptent) || PageReferenced(page)) | 370 | if (pte_young(ptent) || PageReferenced(page)) |
372 | mss->referenced += PAGE_SIZE; | 371 | mss->referenced += PAGE_SIZE; |