zram: introduce zram->tb_lock
authorMinchan Kim <minchan@kernel.org>
Thu, 30 Jan 2014 23:46:03 +0000 (15:46 -0800)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:19 +0000 (11:47 +0900)
commitaebfe82dd86d448ffb08876c572329126fb196c7
tree3c306741704abd26df537d22da15ac44478b2937
parent9bf2236ffcc4ade2f86066e651e734fdf72a4362
zram: introduce zram->tb_lock

Currently, the zram table is protected by zram->lock but it's rather
coarse-grained lock and it makes hard for scalibility.

Let's use own rwlock instead of depending on zram->lock.  This patch
adds new locking so obviously, it would make slow but this patch is just
prepartion for removing coarse-grained rw_semaphore(ie, zram->lock)
which is hurdle about zram scalability.

Final patch in this patchset series will remove the lock from read-path
and change rw_semaphore with mutex in write path.  With bonus, we could
drop pending slot free mess in next patch.

Change-Id: If5456f871bc6b0d6ee1f8218fde3f5a13d261c8b
Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.h