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 ?
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 ?
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 ?
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 !