Skip to content

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