diff options
| author | Minchan Kim <minchan@kernel.org> | 2014-01-30 15:46:03 -0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2016-12-11 12:59:21 +0100 |
| commit | b3aef48bf1ce35dde13aad91fa441d996635410a (patch) | |
| tree | 18f6a77f9bf0dcdddf6bf20fb0d27d2e1bec9e03 /include/linux/zram_drv.h | |
| parent | 603e34fdd8e5311ad5028fb9dcb0839dd520f219 (diff) | |
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.
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>
Diffstat (limited to 'include/linux/zram_drv.h')
| -rw-r--r-- | include/linux/zram_drv.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/zram_drv.h b/include/linux/zram_drv.h index afe9a3e73..c89878172 100644 --- a/include/linux/zram_drv.h +++ b/include/linux/zram_drv.h @@ -83,6 +83,7 @@ struct zram_stats { }; struct zram_meta { + rwlock_t tb_lock; /* protect table */ void *compress_workmem; void *compress_buffer; struct table *table; @@ -96,7 +97,7 @@ struct zram_slot_free { struct zram { struct zram_meta *meta; - struct rw_semaphore lock; /* protect compression buffers, table, + struct rw_semaphore lock; /* protect compression buffers, * reads and writes */ |
