Skip to content

Commit e79d27d

Browse files
Dmitrii Kuvaiskiikailun-qin
Dmitrii Kuvaiskii
authored andcommitted
[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]>
1 parent 21ae038 commit e79d27d

File tree

1 file changed

+115
-53
lines changed

1 file changed

+115
-53
lines changed

0 commit comments

Comments
 (0)