From owner-svn-src-all@FreeBSD.ORG Fri May 29 13:56:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AECE1065709; Fri, 29 May 2009 13:56:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1D378FC13; Fri, 29 May 2009 13:56:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4TDuYXa076615; Fri, 29 May 2009 13:56:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4TDuYaP076613; Fri, 29 May 2009 13:56:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905291356.n4TDuYaP076613@svn.freebsd.org> From: John Baldwin Date: Fri, 29 May 2009 13:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193035 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2009 13:56:36 -0000 Author: jhb Date: Fri May 29 13:56:34 2009 New Revision: 193035 URL: http://svn.freebsd.org/changeset/base/193035 Log: Tweak a few comments on adaptive spinning. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri May 29 13:48:42 2009 (r193034) +++ head/sys/kern/kern_mutex.c Fri May 29 13:56:34 2009 (r193035) @@ -399,8 +399,11 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t #ifdef ADAPTIVE_MUTEXES /* - * If the current owner of the lock is executing on another - * CPU quit the hard path and try to spin. + * The current lock owner might have started executing + * on another CPU (or the lock could have changed + * owners) while we were waiting on the turnstile + * chain lock. If so, drop the turnstile lock and try + * again. */ owner = (struct thread *)(v & ~MTX_FLAGMASK); if (TD_IS_RUNNING(owner)) { Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Fri May 29 13:48:42 2009 (r193034) +++ head/sys/kern/kern_rwlock.c Fri May 29 13:56:34 2009 (r193035) @@ -412,8 +412,11 @@ _rw_rlock(struct rwlock *rw, const char #ifdef ADAPTIVE_RWLOCKS /* - * If the current owner of the lock is executing on another - * CPU quit the hard path and try to spin. + * The current lock owner might have started executing + * on another CPU (or the lock could have changed + * owners) while we were waiting on the turnstile + * chain lock. If so, drop the turnstile lock and try + * again. */ if ((v & RW_LOCK_READ) == 0) { owner = (struct thread *)RW_OWNER(v); @@ -714,8 +717,11 @@ _rw_wlock_hard(struct rwlock *rw, uintpt #ifdef ADAPTIVE_RWLOCKS /* - * If the current owner of the lock is executing on another - * CPU quit the hard path and try to spin. + * The current lock owner might have started executing + * on another CPU (or the lock could have changed + * owners) while we were waiting on the turnstile + * chain lock. If so, drop the turnstile lock and try + * again. */ if (!(v & RW_LOCK_READ)) { owner = (struct thread *)RW_OWNER(v);