From: Johannes Weiner Subject: [PATCH 01/20] mm: print swapcache page count in show_swap_cache_info() Date: Fri, 27 Jun 2008 13:53:50 +0200 Message-ID: <20080627120047.908072507@saeurebad.de> References: <20080627115349.743368154@saeurebad.de> Return-path: Received: from saeurebad.de ([85.214.36.134]:38990 "EHLO saeurebad.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760415AbYF0MFK (ORCPT ); Fri, 27 Jun 2008 08:05:10 -0400 Content-Disposition: inline; filename=0002-swapcache-page-count.patch Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org 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 --- mm/swap_state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -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)); --