steam-deck-utilities icon indicating copy to clipboard operation
steam-deck-utilities copied to clipboard

Add page-cluster tweak

Open xeome opened this issue 2 years ago • 2 comments

The page-cluster value controls the number of pages that are read in from swap in a single attempt, similar to the page cache readahead. The consecutive pages are not based on virtual or physical addresses, but consecutive on swap space, meaning they were swapped out together.

The page-cluster value is a logarithmic value. Setting it to zero means one page, setting it to one means two pages, setting it to two means four pages, etc. A value of zero disables swap readahead completely.

The default value is three (eight pages at a time). However, tuning this value to a different value may provide small benefits if the workload is swap-intensive. Lower values mean lower latencies for initial faults, but at the same time, extra faults and I/O delays for following faults if they would have been part of that consecutive pages readahead would have brought in.

I think games could benefit from this as they are latency sensitive. If you need benchmarks and data, you can check this article I wrote Zram (page is about zram but it also compares different page-cluster values)

xeome avatar Feb 24 '23 15:02 xeome

This will require quite a bit of testing, so will likely be an open PR for a while, but I really look forward to putting it through its paces!

CryoByte33 avatar Feb 25 '23 08:02 CryoByte33

Found some additional information on the subject here:

https://www.reddit.com/r/Fedora/comments/mzun99/new_zram_tuning_benchmarks/

emansom avatar May 31 '23 10:05 emansom