summaryrefslogtreecommitdiff
path: root/Documentation/admin-guide/blockdev
diff options
context:
space:
mode:
authorBrian Geffon <bgeffon@google.com>2022-04-29 14:36:59 -0700
committerakpm <akpm@linux-foundation.org>2022-04-29 14:36:59 -0700
commit30226b69f8767a822f87c2c92bf6d4fbf545cee1 (patch)
tree82135091db3f41f3fcc5be73c4a6679f9c27bb6b /Documentation/admin-guide/blockdev
parentd137a7cb9b2ab8155184b2da9a304afff8f84d36 (diff)
zram: add a huge_idle writeback mode
Today it's only possible to write back as a page, idle, or huge. A user might want to writeback pages which are huge and idle first as these idle pages do not require decompression and make a good first pass for writeback. Idle writeback specifically has the advantage that a refault is unlikely given that the page has been swapped for some amount of time without being refaulted. Huge writeback has the advantage that you're guaranteed to get the maximum benefit from a single page writeback, that is, you're reclaiming one full page of memory. Pages which are compressed in zram being written back result in some benefit which is always less than a page size because of the fact that it was compressed. The primary use of this is for minimizing refaults in situations where the device has to be sensitive to storage endurance. On ChromeOS we have devices with slow eMMC and repeated writes and refaults can negatively affect performance and endurance. Link: https://lkml.kernel.org/r/20220322215821.1196994-1-bgeffon@google.com Signed-off-by: Brian Geffon <bgeffon@google.com> Acked-by: Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'Documentation/admin-guide/blockdev')
-rw-r--r--Documentation/admin-guide/blockdev/zram.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/admin-guide/blockdev/zram.rst b/Documentation/admin-guide/blockdev/zram.rst
index 54fe63745ed8..c73b16930449 100644
--- a/Documentation/admin-guide/blockdev/zram.rst
+++ b/Documentation/admin-guide/blockdev/zram.rst
@@ -343,6 +343,11 @@ Admin can request writeback of those idle pages at right timing via::
With the command, zram will writeback idle pages from memory to the storage.
+Additionally, if a user choose to writeback only huge and idle pages
+this can be accomplished with::
+
+ echo huge_idle > /sys/block/zramX/writeback
+
If an admin wants to write a specific page in zram device to the backing device,
they could write a page index into the interface.