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

[LibOS] Use RW locks in the VMA tree #1795

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jul 30, 2024

  1. [LibOS] Use RW locks in the VMA tree

    Multi-threaded workloads with many syscalls stress the VMA subsystem of
    LibOS, because almost all syscalls verify their buffers for read/write
    access using the functions `is_user_memory_readable()`,
    `is_user_memory_writable()`, etc. All these functions end up in
    VMA-specific `is_in_adjacent_user_vmas()` that grabs a global VMA lock.
    On some multi-threaded apps like MongoDB, this lock contention becomes
    the performance bottleneck.
    
    This commit tries to remove this bottleneck by switching from a spinlock
    to the Read-Write (RW) lock. The intuition is that most of the time,
    a read-only `is_in_adjacent_user_vmas()` func is called, which now uses
    the read lock.
    
    Signed-off-by: Dmitrii Kuvaiskii <[email protected]>
    Dmitrii Kuvaiskii committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    b27f24e View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. fixup! [LibOS] Use RW locks in the VMA tree

    Signed-off-by: Dmitrii Kuvaiskii <[email protected]>
    Dmitrii Kuvaiskii committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    e5c7691 View commit details
    Browse the repository at this point in the history