cvs commit: src/lib/libthr/thread thr_mutex.c thr_umtx.c
thr_umtx.h src/sys/kern kern_umtx.c src/sys/sys umtx.h
David Xu
davidxu at FreeBSD.org
Tue Jun 24 07:37:44 UTC 2008
davidxu 2008-06-24 07:32:12 UTC
FreeBSD src repository
Modified files:
lib/libthr/thread thr_mutex.c thr_umtx.c thr_umtx.h
sys/kern kern_umtx.c
sys/sys umtx.h
Log:
SVN rev 179970 on 2008-06-24 07:32:12Z by davidxu
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
Revision Changes Path
1.75 +33 -35 src/lib/libthr/thread/thr_mutex.c
1.17 +60 -10 src/lib/libthr/thread/thr_umtx.c
1.14 +13 -9 src/lib/libthr/thread/thr_umtx.h
1.71 +142 -35 src/sys/kern/kern_umtx.c
1.33 +3 -1 src/sys/sys/umtx.h
More information about the cvs-src
mailing list