Monitor and report dirty pages in Linux Kernel for a specific process. We provide two implementations:
- Reading maps, pagemaps, and kpageflags files from sysfs
- Linux kernel module that read the page cache for the specific file. This implementation is for Linux kernel v.6.1.
cd sysfs
make
./example <filename> <size> <num_dirty_pages>
cd module
# Edit the version of the kernel inside the Makefile
# Edit the username for /dev/trace_dirty_pages
# You need sudo permissions
make
cd tests
# Edit the username for /dev/trace_dirty_pages
# Replace the path /mnt/fmap/file.txt with your own path
make
./example <filename> <size> <num_dirty_pages>
We do not support at this time in the kernel module the use of madvise. Madvise splits the vma area so we do not handle this case