]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
zram: document writeback_batch_size
authorSergey Senozhatsky <senozhatsky@chromium.org>
Mon, 1 Dec 2025 09:47:50 +0000 (18:47 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 21 Jan 2026 03:24:36 +0000 (19:24 -0800)
Add missing writeback_batch_size documentation.

Link: https://lkml.kernel.org/r/20251201094754.4149975-4-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Brian Geffon <bgeffon@google.com>
Cc: David Stevens <stevensd@google.com>
Cc: Minchan Kim <minchan@google.com>
Cc: Richard Chang <richardycc@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/ABI/testing/sysfs-block-zram
Documentation/admin-guide/blockdev/zram.rst

index ed10c2e4b5c293abd2c65416fc54c14e2ebb1a85..e538d4850d6112437861bcc09e0669766c383978 100644 (file)
@@ -157,3 +157,10 @@ Contact:   Richard Chang <richardycc@google.com>
 Description:
                The writeback_compressed device atrribute toggles compressed
                writeback feature.
+
+What:          /sys/block/zram<id>/writeback_batch_size
+Date:          November 2025
+Contact:       Sergey Senozhatsky <senozhatsky@chromium.org>
+Description:
+               The writeback_batch_size device atrribute sets the maximum
+               number of in-flight writeback operations.
index 9547e4e959791c26e950c5d0c1bd6444a028881f..94bb7f2245eef26c49116ae730afe9ef6e881998 100644 (file)
@@ -214,6 +214,8 @@ mem_limit           WO      specifies the maximum amount of memory ZRAM can
 writeback_limit        WO      specifies the maximum amount of write IO zram
                                can write out to backing device as 4KB unit
 writeback_limit_enable  RW     show and set writeback_limit feature
+writeback_batch_size   RW      show and set maximum number of in-flight
+                               writeback operations
 writeback_compressed   RW      show and set compressed writeback feature
 comp_algorithm         RW      show and change the compression algorithm
 algorithm_params       WO      setup compression algorithm parameters
@@ -223,7 +225,6 @@ backing_dev         RW      set up backend storage for zram to write out
 idle                   WO      mark allocated slot as idle
 ======================  ======  ===============================================
 
-
 User space is advised to use the following files to read the device statistics.
 
 File /sys/block/zram<id>/stat
@@ -447,6 +448,14 @@ this feature, execute::
 Note that this feature should be configured before the `zramX` device is
 initialized.
 
+Depending on backing device storage type, writeback operation may benefit
+from a higher number of in-flight write requests (batched writes).  The
+number of maximum in-flight writeback operations can be configured via
+`writeback_batch_size` attribute.  To change the default value (which is 32),
+execute::
+
+       $ echo 64 > /sys/block/zramX/writeback_batch_size
+
 If admin wants to measure writeback count in a certain period, they could
 know it via /sys/block/zram0/bd_stat's 3rd column.