Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Apr 2015 00:43:25 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r281346 - in stable/10/sys/geom: mirror raid
Message-ID:  <201504100043.t3A0hPLb034397@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Apr 10 00:43:24 2015
New Revision: 281346
URL: https://svnweb.freebsd.org/changeset/base/281346

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/10/sys/geom/mirror/g_mirror.c
  stable/10/sys/geom/raid/g_raid.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/geom/mirror/g_mirror.c
==============================================================================
--- stable/10/sys/geom/mirror/g_mirror.c	Thu Apr  9 23:09:47 2015	(r281345)
+++ stable/10/sys/geom/mirror/g_mirror.c	Fri Apr 10 00:43:24 2015	(r281346)
@@ -894,7 +894,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);
 }
@@ -981,7 +981,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);
@@ -1021,7 +1021,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);
 }
@@ -1150,7 +1150,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/10/sys/geom/raid/g_raid.c
==============================================================================
--- stable/10/sys/geom/raid/g_raid.c	Thu Apr  9 23:09:47 2015	(r281345)
+++ stable/10/sys/geom/raid/g_raid.c	Fri Apr 10 00:43:24 2015	(r281346)
@@ -1143,7 +1143,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);
@@ -1355,7 +1355,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);
@@ -1449,7 +1449,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504100043.t3A0hPLb034397>