hoytech / vmtouch

Portable file system cache diagnostics and control
https://hoytech.com/vmtouch/
BSD 3-Clause "New" or "Revised" License
1.79k stars 210 forks source link

evict not work with gcc -O0 #89

Open pukaifei opened 3 years ago

pukaifei commented 3 years ago
  1. If vmtouch.c is compiled with gcc -O2, evict succeeds by calling posix_fadvise. But with gcc -O0, evict fails and mincore shows that memory is still used. What's the difference between -O2 and -O0 for posix_fadvise ?

  2. If use mmap, mlock, munlock sequentially, then call posix_fadvise and mincore shows that memory is still used. If mlock and munlock is skipped, posix_fadvise succeeds.
    I know that posix_fadivse is async, but how does lock affects it ?

Thanks !