From owner-svn-src-stable@FreeBSD.ORG Fri Apr 10 09:52:18 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A100BE8F; Fri, 10 Apr 2015 09:52:18 +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 8B232A58; Fri, 10 Apr 2015 09:52:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3A9qIcw096724; Fri, 10 Apr 2015 09:52:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3A9qIx2096722; Fri, 10 Apr 2015 09:52:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201504100952.t3A9qIx2096722@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 10 Apr 2015 09:52:18 +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: r281364 - in stable/9/sys/geom: mirror raid 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-1 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: Fri, 10 Apr 2015 09:52:18 -0000 Author: mav Date: Fri Apr 10 09:52:17 2015 New Revision: 281364 URL: https://svnweb.freebsd.org/changeset/base/281364 Log: MFC r280757: Remove request sorting from GEOM_MIRROR and GEOM_RAID. When CPU is not busy, those queues are typically empty. When CPU is busy, then one more extra sorting is the last thing it needs. If specific device (HDD) really needs sorting, then it will be done later by CAM. This supposed to fix livelock reported for mirror of two SSDs, when UFS fires zillion of BIO_DELETE requests, that totally blocks I/O subsystem by pointless sorting of requests and responses under single mutex lock. Modified: stable/9/sys/geom/mirror/g_mirror.c stable/9/sys/geom/raid/g_raid.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/9/sys/geom/mirror/g_mirror.c Fri Apr 10 09:50:13 2015 (r281363) +++ stable/9/sys/geom/mirror/g_mirror.c Fri Apr 10 09:52:17 2015 (r281364) @@ -861,7 +861,7 @@ g_mirror_done(struct bio *bp) sc = bp->bio_from->geom->softc; bp->bio_cflags = G_MIRROR_BIO_FLAG_REGULAR; mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); } @@ -948,7 +948,7 @@ g_mirror_regular_request(struct bio *bp) else { pbp->bio_error = 0; mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, pbp); + bioq_insert_tail(&sc->sc_queue, pbp); mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); @@ -988,7 +988,7 @@ g_mirror_sync_done(struct bio *bp) sc = bp->bio_from->geom->softc; bp->bio_cflags = G_MIRROR_BIO_FLAG_SYNC; mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); } @@ -1103,7 +1103,7 @@ g_mirror_start(struct bio *bp) return; } mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); Modified: stable/9/sys/geom/raid/g_raid.c ============================================================================== --- stable/9/sys/geom/raid/g_raid.c Fri Apr 10 09:50:13 2015 (r281363) +++ stable/9/sys/geom/raid/g_raid.c Fri Apr 10 09:52:17 2015 (r281364) @@ -1142,7 +1142,7 @@ g_raid_start(struct bio *bp) return; } mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); if (!dumping) { G_RAID_DEBUG1(4, sc, "Waking up %p.", sc); @@ -1354,7 +1354,7 @@ g_raid_unlock_range(struct g_raid_volume (intmax_t)(lp->l_offset+lp->l_length)); mtx_lock(&sc->sc_queue_mtx); while ((bp = bioq_takefirst(&vol->v_locked)) != NULL) - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); free(lp, M_RAID); return (0); @@ -1448,7 +1448,7 @@ g_raid_disk_done(struct bio *bp) sd = bp->bio_caller1; sc = sd->sd_softc; mtx_lock(&sc->sc_queue_mtx); - bioq_disksort(&sc->sc_queue, bp); + bioq_insert_tail(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); if (!dumping) wakeup(sc);