smaps: account swap entries
Subsystems (3)
PATCH 1/1 smaps: account swap entries
Show the amount of swap for each vma. This can be used to see where all the swap goes.
Signed-off-by Peter Zijlstra <[email protected]>
--- fs/proc/task_mmu.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
fs/proc/task_mmu.c +11 -2
@@ -313,6 +313,7 @@ struct mem_size_statsunsigned long private_clean;unsigned long private_dirty;unsigned long referenced; +unsigned long swap;u64 pss; };
@@ -329,6 +330,12 @@ static int smaps_pte_range(pmd_t *pmd, u pte =pte_offset_map_lock (vma->vm_mm, pmd, addr, &ptl);for (; addr != end; pte++, addr +=PAGE_SIZE ) { ptent = *pte; + +if (is_swap_pte (ptent)) { + mss->swap +=PAGE_SIZE ; +continue ; + } +if (!pte_present (ptent))continue ;
@@ -387,7 +394,8 @@ static int show_smap(struct seq_file *m,"Shared_Dirty: %8lu kB\n" "Private_Clean: %8lu kB\n" "Private_Dirty: %8lu kB\n" -"Referenced: %8lu kB\n" , +"Referenced: %8lu kB\n" +"Swap: %8lu kB\n" , (vma->vm_end - vma->vm_start) >>10 , mss.resident >>10 , (unsigned long)(mss.pss >> (10 + PSS_SHIFT)),
@@ -395,7 +403,8 @@ static int show_smap(struct seq_file *m, mss.shared_dirty >>10 , mss.private_clean >>10 , mss.private_dirty >>10 , - mss.referenced >> 10); + mss.referenced >>10 , + mss.swap >> 10);return ret; }
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 6 lines · Peter Zijlstra
Subject: smaps: account swap entries
Show the amount of swap for each vma. This can be used to see where all the swap goes.
Signed-off-by Peter Zijlstra <[email protected]>
Looks great to me.
Acked-by Matt Mackall <[email protected]>
Signature · 7 lines
Mathematics is the supreme nostalgia of our time. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
KOSAKI Motohiro
Acked-byQuoted 5 lines
Quoted 1 line
Signed-off-by Peter Zijlstra <[email protected]>Looks great to me.
Acked-by Matt Mackall <[email protected]>
me too :)
Acked-by KOSAKI Motohiro <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>