From: Seth Jennings Date: Tue, 4 Oct 2011 13:21:32 +0000 (-0500) Subject: staging: zcache: reduce tmem bucket lock contention X-Git-Tag: v3.2-rc1~169^2^2~107 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d65c85f9187d311dbf1bf9e7fc2f5091a770853;p=pandora-kernel.git staging: zcache: reduce tmem bucket lock contention tmem uses hash buckets each with their own rbtree and lock to quickly lookup tmem objects. tmem has TMEM_HASH_BUCKETS (256) buckets per pool. However, because of the way the tmem_oid is generated for frontswap pages, only 16 unique tmem_oids are being generated, resulting in only 16 of the 256 buckets being used. This cause high lock contention for the per bucket locks. This patch changes SWIZ_BITS to include more bits of the offset. The result is that all 256 hash buckets are potentially used resulting in a 95% drop in hash bucket lock contention. Signed-off-by: Seth Jennings Acked-by: Dan Magenheimer Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed