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 support for cachestat() syscall #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oandrew
Copy link

@oandrew oandrew commented Oct 2, 2024

Linux 6.5 added new cachestat() syscall to obtain page cache statistics for a given fd. It is much faster than mincore(), especially on big files.
Update vmtouch to use cachestat() when it's available and none of the -t, -e, -v flags are passed.
Additionally, cachestat() reports correct numbers even without write permissions on files. (https://lwn.net/Articles/778437/)

On my machine, running vmtouch on directory with:

  • Linux kernel checkout (96962 files, 7Gb total)
Before: 1.2s 
After:  0.6s
  • Large media files (417 files, 139Gb total)
Before: 800ms
After:   13ms

Linux 6.5 added new cachestat() syscall to obtain page cache statistics
for a given fd. It is much faster than mincore(), especially on big
files.
Update vmtouch to use cachestat() when it's available and none of the
-t, -e, -v flags are passed.
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.

1 participant