New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vmtouch load file into memory even without any arguments. #2
Comments
I have not observed this behaviour before. With no arguments, vmtouch is only supposed to open() the file, mmap() it, and then call mincore() on the memory. It is possible that the OS is prefetching the file which would be undesirable from the vmtouch perspective. I'll try to look into this further. Thanks for the report. |
Please re-open this if more information comes up and/or a reproducible test case is built. Thanks. |
Well I can reproduce it on every Gentoo's deployment I have, with or without lvm and dmcrypt, 32bit and 64bit. Also on 64bit Debian, when I test <50 kB files it does not 'load them' when testing 200kB and bigger files it always is touched into memory ./vmtouch /var/cache/apt/archives/*Files: 496 I am not sure hwo can I reopen this bug tho... |
OK I will try to look into why this is. Maybe there's an mmap flag or something we can use to prevent the OS from pre-fetching if that is in fact what's happening. Thanks for the follow-up. Reopening the issue. |
Friendly bump |
Sorry nothing yet, but I am on-and-off working on a "libvmtouch" that will have a much better test suite and should help diagnose this issue. |
Hey, Seems like the issue is no more. I've tested older commits and still, it does work like it should so it had to be something about all the systems I've tried it on. fwiw its no longer an issue with kernel 4.1.0-rc5, glibc 2-21 and gcc 4.9.2. |
Thanks for letting me know. Cheers. |
Hi.
Looks like vmtouch always load into memory whatever it tests. I did some tests on few big files, running 'vmtouch /path/to/foo.mkv' took about 4s and after that printed that the file is 100% in memory, it wasnt. After droping cache via /proc/sys/vm/drop_caches again the vmtouch took 4s and according to
free
the file was just prefetched into memory. I did the test on two boxes, one running ext4, dmcrypt and lvm (many layers) and another running just reiserfs.The text was updated successfully, but these errors were encountered: