From owner-cvs-all@FreeBSD.ORG Tue Apr 1 19:38:23 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A96EE1065672; Tue, 1 Apr 2008 19:38:23 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 265D98FC24; Tue, 1 Apr 2008 19:38:21 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <47F28F34.7060007@FreeBSD.org> Date: Tue, 01 Apr 2008 21:38:28 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: David Xu References: <200803310255.m2V2toJl053104@repoman.freebsd.org> <20080331150346.R72156@desktop> <47F19B89.20601@freebsd.org> In-Reply-To: <47F19B89.20601@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jeff Roberson , src-committers@FreeBSD.org, cvs-all@FreeBSD.org, cvs-src@FreeBSD.org Subject: Re: cvs commit: src/lib/libthr/thread thr_cond.c thr_private.h thr_rwlock.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2008 19:38:23 -0000 David Xu wrote: > Jeff Roberson wrote: >> On Mon, 31 Mar 2008, David Xu wrote: >> >>> davidxu 2008-03-31 02:55:50 UTC >>> >>> FreeBSD src repository >>> >>> Modified files: >>> lib/libthr/thread thr_cond.c thr_private.h thr_rwlock.c >>> Log: >>> Rewrite rwlock to user atomic operations to change rwlock state, this >>> eliminates internal mutex lock contention when most rwlock operations >>> are read. >>> >>> Orignal patch provided by: jeff >> >> Thanks David! >> >> Do you still plan to do kernel side support so we can totally >> eliminate the pthread mutex and condvars from rwlock? I have evidence >> that this would produce further improvements. >> >> Jeff > > I have pure kernel version working, sometimes locking kernel sleep > chain is more expensive than a pure userland mutex locking, since > kernel sleep chain lock is global. I am hestiate adding more code > to kernel since I have tested mysql super-smack and sysbench > read-only and seen no visible performance differences. > all patches are here: > > http://people.freebsd.org/~davidxu/patch/libthr_umtx_rwlock.diff This patch appears to be incomplete (it also doesn't apply cleanly). /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c: In function 'rwlock_rdlock_common': /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c:133: warning: implicit declaration of function '_thr_rwlock_tryrdlock' /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c:173: warning: implicit declaration of function '__thr_rwlock_rdlock' /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c: In function '_pthread_rwlock_trywrlock': /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c:246: warning: implicit declaration of function '_thr_rwlock_trywrlock' /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c: In function '_pthread_rwlock_unlock': /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c:275: warning: implicit declaration of function '_thr_rwlock_unlock' /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c: In function 'rwlock_wrlock_common': /zoo/kris/src8/lib/libthr/thread/thr_rwlock.c:331: warning: implicit declaration of function '__thr_rwlock_wrlock' *** Error code 1 Kris