HomeFreeBSD

Add two commands to _umtx_op system call to allow a simple mutex to be

Description

Add two commands to _umtx_op system call to allow a simple mutex to be
locked and unlocked completely in userland. by locking and unlocking mutex
in userland, it reduces the total time a mutex is locked by a thread,
in some application code, a mutex only protects a small piece of code, the
code's execution time is less than a simple system call, if a lock contention
happens, however in current implemenation, the lock holder has to extend its
locking time and enter kernel to unlock it, the change avoids this disadvantage,
it first sets mutex to free state and then enters kernel and wake one waiter
up. This improves performance dramatically in some sysbench mutex tests.

Tested by: kris
Sounds great: jeff

Details

Provenance
David Xu <davidxu@FreeBSD.org>Authored on Jun 24 2008, 7:32 AM
Parents
rGef0b687ced54: Fix test for waiting AIFs in aac_poll(). This seems to solve the
Branches
Unknown
Tags
Unknown

Event Timeline