From owner-svn-src-stable@freebsd.org Tue Jun 30 05:53:16 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E63E990D2D; Tue, 30 Jun 2015 05:53:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14E331C3F; Tue, 30 Jun 2015 05:53:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5U5rFt7053724; Tue, 30 Jun 2015 05:53:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5U5rFUI053723; Tue, 30 Jun 2015 05:53:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201506300553.t5U5rFUI053723@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 30 Jun 2015 05:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r284944 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jun 2015 05:53:16 -0000 Author: kib Date: Tue Jun 30 05:53:15 2015 New Revision: 284944 URL: https://svnweb.freebsd.org/changeset/base/284944 Log: MFC r284719: Only take previous buffer queue lock (olock) when needed for REMFREE in binsfree(). Modified: stable/10/sys/kern/vfs_bio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_bio.c ============================================================================== --- stable/10/sys/kern/vfs_bio.c Tue Jun 30 00:51:43 2015 (r284943) +++ stable/10/sys/kern/vfs_bio.c Tue Jun 30 05:53:15 2015 (r284944) @@ -963,21 +963,23 @@ binsfree(struct buf *bp, int qindex) BUF_ASSERT_XLOCKED(bp); - olock = bqlock(bp->b_qindex); nlock = bqlock(qindex); - mtx_lock(olock); /* Handle delayed bremfree() processing. */ - if (bp->b_flags & B_REMFREE) + if (bp->b_flags & B_REMFREE) { + olock = bqlock(bp->b_qindex); + mtx_lock(olock); bremfreel(bp); + if (olock != nlock) { + mtx_unlock(olock); + mtx_lock(nlock); + } + } else + mtx_lock(nlock); if (bp->b_qindex != QUEUE_NONE) panic("binsfree: free buffer onto another queue???"); bp->b_qindex = qindex; - if (olock != nlock) { - mtx_unlock(olock); - mtx_lock(nlock); - } if (bp->b_flags & B_AGE) TAILQ_INSERT_HEAD(&bufqueues[bp->b_qindex], bp, b_freelist); else