]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
zram: introduce zram->tb_lock
authorMinchan Kim <minchan@kernel.org>
Wed, 15 Jan 2014 05:56:12 +0000 (16:56 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 16 Jan 2014 05:54:04 +0000 (16:54 +1100)
commit8b00718fe902bf325adf3517f1e5f86f02cec59b
treee55c5c8ec3b95a23348cfafa742373b251469624
parent3a5ddd6378001197b19a310e747ecdaf4c6e6e9d
zram: introduce zram->tb_lock

Currently, 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.

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>
drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.h