staging: zcache: fix serialization bug in zv stats
authorSeth Jennings <sjenning@linux.vnet.ibm.com>
Fri, 30 Dec 2011 16:42:15 +0000 (10:42 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Feb 2012 22:14:14 +0000 (14:14 -0800)
commit2a4830110b90deb4ee99b1ab8c8ebb120f27c0c8
tree642f3ddca90439ff7fff2b76474319de2525807c
parenta9d3c9e3c575ee09c905e07ae7cc1d52e2548d05
staging: zcache: fix serialization bug in zv stats

In a multithreaded workload, the zv_curr_dist_counts
and zv_cumul_dist_counts statistics are being corrupted
because the increments and decrements in zv_create
and zv_free are not atomic.

This patch converts these statistics and their corresponding
increments/decrements/reads to atomic operations.

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/zcache/zcache-main.c