mincore
mincore is a system call that reports a page-residency vector for a mapped virtual-address range.
Only the low bit of each result byte is defined. The start address must be page-aligned; length rounds up to pages. Success returns zero, failure returns -1 with errno, and the snapshot may already be stale on return. [1]
Linux v6.17 permits file-cache disclosure when the caller owns the inode, has the relevant capability, or passes the file write-permission check. Otherwise it returns all-one bytes for that mapping without measuring its residency. Opening a file read-only is not itself the deciding condition. [2]
Relations
- related
- page-cache, memory-mapped-file, posix-fadv-dontneed, rwf-nowait, readahead
Limitations
- Residency does not measure read latency, persistent storage or an application's cache-hit ratio. [3]