Skip to content
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

Use mlock2() instead of mlock() on Linux and use mlockall(MCL_FUTURE). #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 2, 2024

  1. 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.
    ghuls committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    60fa5b0 View commit details
    Browse the repository at this point in the history