zcache: Set SWIZ_BITS to 8 to reduce tmem bucket lock contention.
authorDan Magenheimer <dan.magenheimer@oracle.com>
Mon, 23 Jan 2012 21:52:20 +0000 (16:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Feb 2012 19:17:04 +0000 (11:17 -0800)
commitc1efec8273372700693661f094324081d8f3ad3d
treeb72467fc9880e2e8e45da2e18c5b61155a9ac62f
parent57c313f71800dd93f10f6641650dcb4167fa8739
zcache: Set SWIZ_BITS to 8 to reduce tmem bucket lock contention.

commit e8b4553457e78bcff90f70a31212a40a8fd4f0db upstream.

SWIZ_BITS > 8 results in a much larger number of "tmem_obj"
allocations, likely one per page-placed-in-frontswap.  The
tmem_obj is not huge (roughly 100 bytes), but it is large
enough to add a not-insignificant memory overhead to zcache.

The SWIZ_BITS=8  will get roughly the same lock contention
without the space wastage.

The effect of SWIZ_BITS can be thought of as "2^SWIZ_BITS is
the number of unique oids that be generated" (This concept is
limited to frontswap's use of tmem).

Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/zcache/zcache-main.c