]> git.ipfire.org Git - thirdparty/linux.git/commit
zram: drop pp_in_progress
authorSergey Senozhatsky <senozhatsky@chromium.org>
Tue, 16 Dec 2025 07:13:42 +0000 (16:13 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 03:24:46 +0000 (19:24 -0800)
commit657a81fe3b41bd58c63e15ae282f992dda5c8eee
tree044c05481722dfc3d887fa634afe4fe7ed5f5c46
parent9082f24bd3b700bfc98a24baf794cc7af8f6bcd0
zram: drop pp_in_progress

pp_in_progress makes sure that only one post-processing (writeback or
recomrpession) is active at any given time.  Functionality wise it,
basically, shadows zram init_lock, when init_lock is acquired in writer
mode.

Switch recompress_store() and writeback_store() to take zram init_lock in
writer mode, like all store() sysfs handlers should do, so that we can
drop pp_in_progress.  Recompression and writeback can be somewhat slow, so
holding init_lock in writer mode can block zram attrs reads, but in
reality the only zram attrs reads that take place are mm_stat reads, and
usually it's the same process that reads mm_stat and does recompression or
writeback.

Link: https://lkml.kernel.org/r/20251216071342.687993-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Brian Geffon <bgeffon@google.com>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.h