Skip to content

Commit

Permalink
mm: print swapcache page count in show_swap_cache_info()
Browse files Browse the repository at this point in the history
Every arch implements its own show_mem() function.  Most of them share
quite some code, some of them are completely identical.

This series implements a generic version of this function and migrates
almost all architectures to it.

This patch:

Most show_mem() implementations calculate the amount of pages within
the swapcache every time.  Move the output to a more appropriate place
and use the anyway available total_swapcache_pages variable.

Signed-off-by: Johannes Weiner <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Ivan Kokshaysky <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: Bryan Wu <[email protected]>
Cc: Chris Zankel <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jeff Dike <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: David Howells <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Greg Ungerer <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Roman Zippel <[email protected]>
Cc: Hirokazu Takata <[email protected]>
Cc: Mikael Starvik <[email protected]>
Cc: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Johannes Weiner authored and torvalds committed Jul 26, 2008
1 parent ebcb673 commit 2c97b7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/swap_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ static struct {

void show_swap_cache_info(void)
{
printk("Swap cache: add %lu, delete %lu, find %lu/%lu\n",
printk("%lu pages in swap cache\n", total_swapcache_pages);
printk("Swap cache stats: add %lu, delete %lu, find %lu/%lu\n",
swap_cache_info.add_total, swap_cache_info.del_total,
swap_cache_info.find_success, swap_cache_info.find_total);
printk("Free swap = %lukB\n", nr_swap_pages << (PAGE_SHIFT - 10));
Expand Down

0 comments on commit 2c97b7f

Please sign in to comment.