From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx178.postini.com [74.125.245.178]) by kanga.kvack.org (Postfix) with SMTP id E255A6B003A for ; Thu, 14 Mar 2013 22:35:19 -0400 (EDT) Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Mar 2013 12:27:12 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 2528F2CE8051 for ; Fri, 15 Mar 2013 13:35:14 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2F2MIQ110617330 for ; Fri, 15 Mar 2013 13:22:18 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2F2ZD8f027971 for ; Fri, 15 Mar 2013 13:35:13 +1100 From: Wanpeng Li Subject: [PATCH v3 4/5] introduce zero-filled page stat count Date: Fri, 15 Mar 2013 10:34:19 +0800 Message-Id: <1363314860-22731-5-git-send-email-liwanp@linux.vnet.ibm.com> In-Reply-To: <1363314860-22731-1-git-send-email-liwanp@linux.vnet.ibm.com> References: <1363314860-22731-1-git-send-email-liwanp@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: Greg Kroah-Hartman , Andrew Morton Cc: Dan Magenheimer , Seth Jennings , Konrad Rzeszutek Wilk , Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wanpeng Li Introduce zero-filled page statistics to monitor the number of zero-filled pages. Acked-by: Dan Magenheimer Signed-off-by: Wanpeng Li --- drivers/staging/zcache/zcache-main.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index ef8c960..bc7ccbb 100644 --- a/drivers/staging/zcache/zcache-main.c +++ b/drivers/staging/zcache/zcache-main.c @@ -197,6 +197,7 @@ static ssize_t zcache_eph_nonactive_puts_ignored; static ssize_t zcache_pers_nonactive_puts_ignored; static ssize_t zcache_writtenback_pages; static ssize_t zcache_outstanding_writeback_pages; +static ssize_t zcache_zero_filled_pages; #ifdef CONFIG_DEBUG_FS #include @@ -258,6 +259,7 @@ static int zcache_debugfs_init(void) zdfs("outstanding_writeback_pages", S_IRUGO, root, &zcache_outstanding_writeback_pages); zdfs("writtenback_pages", S_IRUGO, root, &zcache_writtenback_pages); + zdfs("zero_filled_pages", S_IRUGO, root, &zcache_zero_filled_pages); return 0; } #undef zdebugfs @@ -327,6 +329,7 @@ void zcache_dump(void) pr_info("zcache: outstanding_writeback_pages=%zd\n", zcache_outstanding_writeback_pages); pr_info("zcache: writtenback_pages=%zd\n", zcache_writtenback_pages); + pr_info("zcache: zero_filled_pages=%zd\n", zcache_zero_filled_pages); } #endif @@ -563,6 +566,7 @@ static void *zcache_pampd_eph_create(char *data, size_t size, bool raw, kunmap_atomic(user_mem); clen = 0; zero_filled = true; + zcache_zero_filled_pages++; goto got_pampd; } kunmap_atomic(user_mem); @@ -646,6 +650,7 @@ static void *zcache_pampd_pers_create(char *data, size_t size, bool raw, kunmap_atomic(user_mem); clen = 0; zero_filled = true; + zcache_zero_filled_pages++; goto got_pampd; } kunmap_atomic(user_mem); @@ -867,6 +872,7 @@ static int zcache_pampd_get_data_and_free(char *data, size_t *sizep, bool raw, zpages = 1; if (!raw) *sizep = PAGE_SIZE; + zcache_zero_filled_pages--; goto zero_fill; } @@ -923,6 +929,7 @@ static void zcache_pampd_free(void *pampd, struct tmem_pool *pool, zero_filled = true; zsize = 0; zpages = 1; + zcache_zero_filled_pages--; } if (pampd_is_remote(pampd) && !zero_filled) { -- 1.7.7.6 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org