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 <dmitrii.kuvaiskii@intel.com>
  • Loading branch information
Dmitrii Kuvaiskii committed Jul 30, 2024
1 parent f61dbdf commit b27f24e
Showing 1 changed file with 105 additions and 53 deletions.
Loading

0 comments on commit b27f24e

Please sign in to comment.