From owner-cvs-src@FreeBSD.ORG Tue Jun 24 07:37:44 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1421B1065679; Tue, 24 Jun 2008 07:37:44 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id EF1AB8FC2E; Tue, 24 Jun 2008 07:37:43 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5O7bhP7018814; Tue, 24 Jun 2008 07:37:43 GMT (envelope-from davidxu@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5O7bhc5018813; Tue, 24 Jun 2008 07:37:43 GMT (envelope-from davidxu@repoman.freebsd.org) Message-Id: <200806240737.m5O7bhc5018813@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to davidxu@repoman.freebsd.org using -f From: David Xu Date: Tue, 24 Jun 2008 07:32:12 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: 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 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2008 07:37:44 -0000 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