-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use mlock2() instead of mlock() on Linux and use mlockall(MCL_FUTURE).
Use mlock2() instead of mlock() on Linux: - mlock2() allows a third argument MLOCK_ONFAULT, which allow to lock the pages in a range before touching them, so mlock2() can be called before touching all pages instead of after. - "vmtouch -t -l" some_file would not keep the pages in cache after touching them, so at the lock() step they needed to be read again from disk. After this patch files are cached twice as fast on this system. Use mlockall(MCL_FUTURE) instead of mlockall(MCL_CURRENT): - Set mlockall(MCL_FUTURE) before touching pages to have similar behaviour as the mlock2() approach above.
- Loading branch information
Showing
1 changed file
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters