Date: Tue, 24 Jun 2008 07:32:12 +0000 (UTC) From: David Xu <davidxu@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: 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 Message-ID: <200806240737.m5O7bhc5018813@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806240737.m5O7bhc5018813>