File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
TEST!="/dev/zram0", GOTO="zram_end"
2
2
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.
8
12
SYSCTL{vm.swappiness}="150"
9
13
10
14
LABEL="zram_end"
You can’t perform that action at this time.
0 commit comments