Skip to content

zram: locking redesign

Minchan Kim lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 4 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4zram: use atomic operation for statdrivers/staging/zram/zram_drv.c drivers/staging/zram/zram_drv.h+16 -200 replies
2/4zram: introduce zram->tb_lockdrivers/staging/zram/zram_drv.c drivers/staging/zram/zram_drv.h+23 -60 replies
3/4zram: remove workqueue for freeing removed pending slotdrivers/staging/zram/zram_drv.c drivers/staging/zram/zram_drv.h+6 -580 replies
4/4zram: Remove zram->lock in read path and change it with mutexdrivers/staging/zram/zram_drv.c drivers/staging/zram/zram_drv.h+9 -120 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJerome MarchandSergey Senozhatsky
SeriesA-b A-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4]zram: locking redesign

Currently, zram->lock rw_semaphore is coarse-grained so it hurts for scalability.
This patch try to enhance it with remove the lock in read path.

[1] uses atomic opeartion so it removes dependency of 32bit stat from zram->lock.
[2] introduces table own lock instead of relying on zram->lock.
[3] remove free pending slot mess so it makes core very clean.
[4] finally removes zram->lock in read path and changes it with mutex.

So, output is wonderful. read/write mixed workload performs well 11 times than old and write concurrency is also enhanced because mutex supports SPIN_ON_OWNER while rw_semaphore doesn't yet. (I know recenty there were some effort to enhance it for rw_semaphore from Tim Chen but not sure it got merged. Anyway, we don't need it any more and there is no reason to prevent read-write concurrency)

Thanks.

Minchan Kim (4):
[1] zram: use atomic operation for stat
[2] zram: introduce zram->tb_lock
[3] zram: remove workqueue for freeing removed pending slot
[4] zram: Remove zram->lock in read path and change it with mutex

 drivers/staging/zram/zram_drv.c | 117 ++++++++++++++++------------------------
 drivers/staging/zram/zram_drv.h |  27 +++-------
 2 files changed, 51 insertions(+), 93 deletions(-)
Signature · 1 line
1.8.5.2