summaryrefslogtreecommitdiff
path: root/drivers/staging/zcache/debug.h
diff options
context:
space:
mode:
authorWanpeng Li <liwanp@linux.vnet.ibm.com>2013-04-03 10:16:22 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-03 20:38:37 (GMT)
commit834e3a1cead22c40ad55dad9cd683e42396d45c1 (patch)
tree8fe408554bd84a86099ae5a998ea9b844cf053e1 /drivers/staging/zcache/debug.h
parent90874fc21ca6ca46058c5039fe78a4155d9a631e (diff)
downloadlinux-fsl-qoriq-834e3a1cead22c40ad55dad9cd683e42396d45c1.tar.xz
staging: zcache: introduce zero-filled page stat count
Introduce zero-filled page statistics to monitor the number of zero-filled pages. Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/zcache/debug.h')
-rw-r--r--drivers/staging/zcache/debug.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/staging/zcache/debug.h b/drivers/staging/zcache/debug.h
index 8ec82d4..ddad92f 100644
--- a/drivers/staging/zcache/debug.h
+++ b/drivers/staging/zcache/debug.h
@@ -122,6 +122,21 @@ static inline void dec_zcache_pers_zpages(unsigned zpages)
zcache_pers_zpages = atomic_sub_return(zpages, &zcache_pers_zpages_atomic);
}
+extern ssize_t zcache_zero_filled_pages;
+static atomic_t zcache_zero_filled_pages_atomic = ATOMIC_INIT(0);
+extern ssize_t zcache_zero_filled_pages_max;
+static inline void inc_zcache_zero_filled_pages(void)
+{
+ zcache_zero_filled_pages = atomic_inc_return(
+ &zcache_zero_filled_pages_atomic);
+ if (zcache_zero_filled_pages > zcache_zero_filled_pages_max)
+ zcache_zero_filled_pages_max = zcache_zero_filled_pages;
+}
+static inline void dec_zcache_zero_filled_pages(void)
+{
+ zcache_zero_filled_pages = atomic_dec_return(
+ &zcache_zero_filled_pages_atomic);
+}
static inline unsigned long curr_pageframes_count(void)
{
return zcache_pageframes_alloced -
@@ -200,6 +215,8 @@ static inline void inc_zcache_eph_zpages(void) { };
static inline void dec_zcache_eph_zpages(unsigned zpages) { };
static inline void inc_zcache_pers_zpages(void) { };
static inline void dec_zcache_pers_zpages(unsigned zpages) { };
+static inline void inc_zcache_zero_filled_pages(void) { };
+static inline void dec_zcache_zero_filled_pages(void) { };
static inline unsigned long curr_pageframes_count(void)
{
return 0;