Skip to content

Commit 51f73ff

Browse files
Srividya Desireddytorvalds
authored andcommitted
Documentation/vm/zswap.txt: update with same-value filled page feature
Update zswap document with details on same-value filled pages identification feature. The usage of zswap.same_filled_pages_enabled module parameter is explained. Link: http://lkml.kernel.org/r/20171206114852epcms5p6973b02a9f455d5d3c765eafda0fe2631@epcms5p6 Signed-off-by: Srividya Desireddy <srividya.dr@samsung.com> Acked-by: Dan Streetman <ddstreet@ieee.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3756f64 commit 51f73ff

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎Documentation/vm/zswap.txt‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,25 @@ request is made for a page in an old zpool, it is uncompressed using its
9898
original compressor. Once all pages are removed from an old zpool, the zpool
9999
and its compressor are freed.
100100

101+
Some of the pages in zswap are same-value filled pages (i.e. contents of the
102+
page have same value or repetitive pattern). These pages include zero-filled
103+
pages and they are handled differently. During store operation, a page is
104+
checked if it is a same-value filled page before compressing it. If true, the
105+
compressed length of the page is set to zero and the pattern or same-filled
106+
value is stored.
107+
108+
Same-value filled pages identification feature is enabled by default and can be
109+
disabled at boot time by setting the "same_filled_pages_enabled" attribute to 0,
110+
e.g. zswap.same_filled_pages_enabled=0. It can also be enabled and disabled at
111+
runtime using the sysfs "same_filled_pages_enabled" attribute, e.g.
112+
113+
echo 1 > /sys/module/zswap/parameters/same_filled_pages_enabled
114+
115+
When zswap same-filled page identification is disabled at runtime, it will stop
116+
checking for the same-value filled pages during store operation. However, the
117+
existing pages which are marked as same-value filled pages remain stored
118+
unchanged in zswap until they are either loaded or invalidated.
119+
101120
A debugfs interface is provided for various statistic about pool size, number
102-
of pages stored, and various counters for the reasons pages are rejected.
121+
of pages stored, same-value filled pages and various counters for the reasons
122+
pages are rejected.

0 commit comments

Comments
 (0)