From owner-svn-src-stable@FreeBSD.ORG Thu May 8 12:27:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DFB0692C; Thu, 8 May 2014 12:27:24 +0000 (UTC) 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 CD635992; Thu, 8 May 2014 12:27:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s48CROg4090419; Thu, 8 May 2014 12:27:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s48CRO9Z090418; Thu, 8 May 2014 12:27:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405081227.s48CRO9Z090418@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 12:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r265672 - stable/9/sys/geom X-SVN-Group: stable-9 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.18 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: Thu, 08 May 2014 12:27:25 -0000 Author: mav Date: Thu May 8 12:27:24 2014 New Revision: 265672 URL: http://svnweb.freebsd.org/changeset/base/265672 Log: MFC r256606: Move g_io_deliver() out of the lock, as required for direct dispatch. Move g_destroy_bio() out too to reduce lock scope even more. Modified: stable/9/sys/geom/geom_disk.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Thu May 8 12:26:08 2014 (r265671) +++ stable/9/sys/geom/geom_disk.c Thu May 8 12:27:24 2014 (r265672) @@ -249,13 +249,14 @@ g_disk_done(struct bio *bp) bp2->bio_completed += bp->bio_completed; if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); - g_destroy_bio(bp); bp2->bio_inbed++; if (bp2->bio_children == bp2->bio_inbed) { + mtx_unlock(&sc->done_mtx); bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed; g_io_deliver(bp2, bp2->bio_error); - } - mtx_unlock(&sc->done_mtx); + } else + mtx_unlock(&sc->done_mtx); + g_destroy_bio(bp); } static int