Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add page-cluster tweak #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add page-cluster tweak #76

wants to merge 2 commits into from

Conversation

xeome
Copy link
Contributor

@xeome xeome commented Feb 24, 2023

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)

@CryoByte33
Copy link
Owner

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!

@emansom
Copy link

emansom commented May 31, 2023

Found some additional information on the subject here:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants