Skip to content

Commit

Permalink
udev/zram: Rewrite comment about swappiness
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Stelmachenok <[email protected]>
  • Loading branch information
ventureoo committed Dec 21, 2024
1 parent 5ace362 commit 0f0ee02
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions usr/lib/udev/rules.d/30-zram.rules
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
TEST!="/dev/zram0", GOTO="zram_end"

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

LABEL="zram_end"

0 comments on commit 0f0ee02

Please sign in to comment.