diff options
-rw-r--r-- | fs/proc/task_mmu.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 02476f5889f1..e2c1155ac09a 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -402,18 +402,20 @@ static void smaps_pte_entry(pte_t ptent, unsigned long addr, | |||
402 | { | 402 | { |
403 | struct mem_size_stats *mss = walk->private; | 403 | struct mem_size_stats *mss = walk->private; |
404 | struct vm_area_struct *vma = mss->vma; | 404 | struct vm_area_struct *vma = mss->vma; |
405 | struct page *page; | 405 | struct page *page = NULL; |
406 | int mapcount; | 406 | int mapcount; |
407 | 407 | ||
408 | if (is_swap_pte(ptent)) { | 408 | if (pte_present(ptent)) { |
409 | mss->swap += ptent_size; | 409 | page = vm_normal_page(vma, addr, ptent); |
410 | return; | 410 | } else if (is_swap_pte(ptent)) { |
411 | } | 411 | swp_entry_t swpent = pte_to_swp_entry(ptent); |
412 | 412 | ||
413 | if (!pte_present(ptent)) | 413 | if (!non_swap_entry(swpent)) |
414 | return; | 414 | mss->swap += ptent_size; |
415 | else if (is_migration_entry(swpent)) | ||
416 | page = migration_entry_to_page(swpent); | ||
417 | } | ||
415 | 418 | ||
416 | page = vm_normal_page(vma, addr, ptent); | ||
417 | if (!page) | 419 | if (!page) |
418 | return; | 420 | return; |
419 | 421 | ||