diff options
author | Konstantin Khlebnikov <[email protected]> | 2012-05-31 16:26:20 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2012-05-31 17:49:29 -0700 |
commit | b1d4d9e0cbd0aecf40c3572e0c8f98de31b3b328 (patch) | |
tree | 5b3dca11bdaa14ce3e34e86016f98634d56fef07 | |
parent | 052fb0d635df5d49dfc85687d94e1a87bf09378d (diff) |
proc/smaps: carefully handle migration entries
Currently smaps reports migration entries as "swap", as result "swap" can
appears in shared mapping.
This patch converts migration entries into pages and handles them as usual.
Signed-off-by: Konstantin Khlebnikov <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Pavel Emelyanov <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-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, { struct mem_size_stats *mss = walk->private; struct vm_area_struct *vma = mss->vma; - struct page *page; + struct page *page = NULL; int mapcount; - if (is_swap_pte(ptent)) { - mss->swap += ptent_size; - return; - } + if (pte_present(ptent)) { + page = vm_normal_page(vma, addr, ptent); + } else if (is_swap_pte(ptent)) { + swp_entry_t swpent = pte_to_swp_entry(ptent); - if (!pte_present(ptent)) - return; + if (!non_swap_entry(swpent)) + mss->swap += ptent_size; + else if (is_migration_entry(swpent)) + page = migration_entry_to_page(swpent); + } - page = vm_normal_page(vma, addr, ptent); if (!page) return; |