summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-03-27 12:44:28 +0000
committermav <mav@FreeBSD.org>2015-03-27 12:44:28 +0000
commit3e52cc4fb2653937bff28751cc028a4c8e79d0d4 (patch)
tree5d13c05d88f129bcb1231ec3f8398fdf8854f562 /sys/geom
parent89133d309eaa5b4083369d1b457633d3b361fc2d (diff)
downloadFreeBSD-src-3e52cc4fb2653937bff28751cc028a4c8e79d0d4.zip
FreeBSD-src-3e52cc4fb2653937bff28751cc028a4c8e79d0d4.tar.gz
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. MFC after: 2 weeks
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/mirror/g_mirror.c8
-rw-r--r--sys/geom/raid/g_raid.c6
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 44e6fa1..d46b3fa 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -888,7 +888,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);
}
@@ -975,7 +975,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);
@@ -1015,7 +1015,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);
}
@@ -1144,7 +1144,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);
diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c
index 546bd20..4156674 100644
--- a/sys/geom/raid/g_raid.c
+++ b/sys/geom/raid/g_raid.c
@@ -1132,7 +1132,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);
@@ -1344,7 +1344,7 @@ g_raid_unlock_range(struct g_raid_volume *vol, off_t off, off_t len)
(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);
@@ -1438,7 +1438,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);
OpenPOWER on IntegriCloud