Skip to content

Commit 5a47074

Browse files
minchanktorvalds
authored andcommitted
zram: add config and doc file for writeback feature
This patch adds document and kconfig for using of writeback feature. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Minchan Kim <[email protected]> Cc: Juneho Choi <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 8e654f8 commit 5a47074

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

Documentation/ABI/testing/sysfs-block-zram

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,11 @@ Description:
9090
device's debugging info useful for kernel developers. Its
9191
format is not documented intentionally and may change
9292
anytime without any notice.
93+
94+
What: /sys/block/zram<id>/backing_dev
95+
Date: June 2017
96+
Contact: Minchan Kim <[email protected]>
97+
Description:
98+
The backing_dev file is read-write and set up backing
99+
device for zram to write incompressible pages.
100+
For using, user should enable CONFIG_ZRAM_WRITEBACK.

Documentation/blockdev/zram.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ max_comp_streams RW the number of possible concurrent compress operations
168168
comp_algorithm RW show and change the compression algorithm
169169
compact WO trigger memory compaction
170170
debug_stat RO this file is used for zram debugging purposes
171+
backing_dev RW set up backend storage for zram to write out
171172

172173

173174
User space is advised to use the following files to read the device statistics.
@@ -231,5 +232,15 @@ line of text and contains the following stats separated by whitespace:
231232
resets the disksize to zero. You must set the disksize again
232233
before reusing the device.
233234

235+
* Optional Feature
236+
237+
= writeback
238+
239+
With incompressible pages, there is no memory saving with zram.
240+
Instead, with CONFIG_ZRAM_WRITEBACK, zram can write incompressible page
241+
to backing storage rather than keeping it in memory.
242+
User should set up backing device via /sys/block/zramX/backing_dev
243+
before disksize setting.
244+
234245
Nitin Gupta
235246

drivers/block/zram/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@ config ZRAM
1313
disks and maybe many more.
1414

1515
See zram.txt for more information.
16+
17+
config ZRAM_WRITEBACK
18+
bool "Write back incompressible page to backing device"
19+
depends on ZRAM
20+
default n
21+
help
22+
With incompressible page, there is no memory saving to keep it
23+
in memory. Instead, write it out to backing device.
24+
For this feature, admin should set up backing device via
25+
/sys/block/zramX/backing_dev.
26+
27+
See zram.txt for more infomration.

0 commit comments

Comments
 (0)