Skip to content

Commit 0f0ee02

Browse files
committed
udev/zram: Rewrite comment about swappiness
Signed-off-by: Vasiliy Stelmachenok <[email protected]>
1 parent 5ace362 commit 0f0ee02

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

usr/lib/udev/rules.d/30-zram.rules

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
TEST!="/dev/zram0", GOTO="zram_end"
22

3-
# Since ZRAM stores all pages in compressed form in RAM, we should prefer
4-
# preempting anonymous pages more than a page (file) cache. Preempting file
5-
# pages may not be desirable because a process may want to access a file at any
6-
# time, whereas if it is preempted, it will cause an additional read cycle from
7-
# the disk.
3+
# When used with ZRAM, it is better to prefer page out only anonymous pages,
4+
# because it ensures that they do not go out of memory, but will be just
5+
# compressed. If we do frequent flushing of file pages, that increases the
6+
# percentage of page cache misses, which in the long term gives additional
7+
# cycles to re-read the same data from disk that was previously in page cache.
8+
# This is the reason why it is recommended to use high values from 100 to keep
9+
# the page cache as hermetic as possible, because otherwise it is "expensive"
10+
# to read data from disk again. At the same time, uncompressing pages from ZRAM
11+
# is not as expensive and is usually very fast on modern CPUs.
812
SYSCTL{vm.swappiness}="150"
913

1014
LABEL="zram_end"

0 commit comments

Comments
 (0)