Skip to content

Commit

Permalink
[LibOS] Use RW locks in the VMA tree
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dimakuv committed Mar 5, 2024
1 parent 4afc550 commit c208c3c
Showing 1 changed file with 100 additions and 48 deletions.
Loading

0 comments on commit c208c3c

Please sign in to comment.