From owner-svn-src-head@FreeBSD.ORG Thu Apr 9 13:09:07 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A86077B6; Thu, 9 Apr 2015 13:09:07 +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 7987766C; Thu, 9 Apr 2015 13:09:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t39D97mv098301; Thu, 9 Apr 2015 13:09:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t39D96RA098295; Thu, 9 Apr 2015 13:09:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504091309.t39D96RA098295@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 9 Apr 2015 13:09:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281310 - in head/sys: geom geom/multipath vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2015 13:09:07 -0000 Author: mav Date: Thu Apr 9 13:09:05 2015 New Revision: 281310 URL: https://svnweb.freebsd.org/changeset/base/281310 Log: Remove sleeps from geom_up thread on device destruction. MFC after: 3 days. Modified: head/sys/geom/geom_dev.c head/sys/geom/multipath/g_multipath.c head/sys/vm/swap_pager.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Thu Apr 9 12:57:58 2015 (r281309) +++ head/sys/geom/geom_dev.c Thu Apr 9 13:09:05 2015 (r281310) @@ -572,7 +572,7 @@ g_dev_done(struct bio *bp2) } mtx_unlock(&sc->sc_mtx); if (destroy) - g_post_event(g_dev_destroy, cp, M_WAITOK, NULL); + g_post_event(g_dev_destroy, cp, M_NOWAIT, NULL); biodone(bp); } Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Thu Apr 9 12:57:58 2015 (r281309) +++ head/sys/geom/multipath/g_multipath.c Thu Apr 9 13:09:05 2015 (r281310) @@ -369,9 +369,9 @@ g_multipath_done(struct bio *bp) mtx_lock(&sc->sc_mtx); (*cnt)--; if (*cnt == 0 && (cp->index & MP_LOST)) { - cp->index |= MP_POSTED; + if (g_post_event(g_mpd, cp, M_NOWAIT, NULL) == 0) + cp->index |= MP_POSTED; mtx_unlock(&sc->sc_mtx); - g_post_event(g_mpd, cp, M_WAITOK, NULL); } else mtx_unlock(&sc->sc_mtx); g_std_done(bp); Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Thu Apr 9 12:57:58 2015 (r281309) +++ head/sys/vm/swap_pager.c Thu Apr 9 13:09:05 2015 (r281310) @@ -2579,7 +2579,6 @@ swapgeom_done(struct bio *bp2) struct swdevt *sp; struct buf *bp; struct g_consumer *cp; - int destroy; bp = bp2->bio_caller2; cp = bp2->bio_from; @@ -2590,15 +2589,14 @@ swapgeom_done(struct bio *bp2) bp->b_error = bp2->bio_error; bufdone(bp); mtx_lock(&sw_dev_mtx); - destroy = ((--cp->index) == 0 && cp->private); - if (destroy) { - sp = bp2->bio_caller1; - sp->sw_id = NULL; + if ((--cp->index) == 0 && cp->private) { + if (g_post_event(swapgeom_close_ev, cp, M_NOWAIT, NULL) == 0) { + sp = bp2->bio_caller1; + sp->sw_id = NULL; + } } mtx_unlock(&sw_dev_mtx); g_destroy_bio(bp2); - if (destroy) - g_waitfor_event(swapgeom_close_ev, cp, M_WAITOK, NULL); } static void