MFC r201566, r201567:

Move wakeup() out of mutex to reduce contention.
This commit is contained in:
Alexander Motin 2010-02-05 11:56:12 +00:00
parent 9185a70204
commit 981b11104a
2 changed files with 7 additions and 7 deletions

View File

@ -868,8 +868,8 @@ g_mirror_done(struct bio *bp)
bp->bio_cflags = G_MIRROR_BIO_FLAG_REGULAR;
mtx_lock(&sc->sc_queue_mtx);
bioq_disksort(&sc->sc_queue, bp);
wakeup(sc);
mtx_unlock(&sc->sc_queue_mtx);
wakeup(sc);
}
static void
@ -954,9 +954,9 @@ g_mirror_regular_request(struct bio *bp)
pbp->bio_error = 0;
mtx_lock(&sc->sc_queue_mtx);
bioq_disksort(&sc->sc_queue, pbp);
mtx_unlock(&sc->sc_queue_mtx);
G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc);
wakeup(sc);
mtx_unlock(&sc->sc_queue_mtx);
}
break;
case BIO_DELETE:
@ -994,8 +994,8 @@ g_mirror_sync_done(struct bio *bp)
bp->bio_cflags = G_MIRROR_BIO_FLAG_SYNC;
mtx_lock(&sc->sc_queue_mtx);
bioq_disksort(&sc->sc_queue, bp);
wakeup(sc);
mtx_unlock(&sc->sc_queue_mtx);
wakeup(sc);
}
static void
@ -1107,9 +1107,9 @@ g_mirror_start(struct bio *bp)
}
mtx_lock(&sc->sc_queue_mtx);
bioq_disksort(&sc->sc_queue, bp);
mtx_unlock(&sc->sc_queue_mtx);
G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc);
wakeup(sc);
mtx_unlock(&sc->sc_queue_mtx);
}
/*

View File

@ -1271,9 +1271,9 @@ g_raid3_done(struct bio *bp)
G_RAID3_LOGREQ(3, bp, "Regular request done (error=%d).", bp->bio_error);
mtx_lock(&sc->sc_queue_mtx);
bioq_insert_head(&sc->sc_queue, bp);
mtx_unlock(&sc->sc_queue_mtx);
wakeup(sc);
wakeup(&sc->sc_queue);
mtx_unlock(&sc->sc_queue_mtx);
}
static void
@ -1379,9 +1379,9 @@ g_raid3_sync_done(struct bio *bp)
bp->bio_cflags |= G_RAID3_BIO_CFLAG_SYNC;
mtx_lock(&sc->sc_queue_mtx);
bioq_insert_head(&sc->sc_queue, bp);
mtx_unlock(&sc->sc_queue_mtx);
wakeup(sc);
wakeup(&sc->sc_queue);
mtx_unlock(&sc->sc_queue_mtx);
}
static void
@ -1459,9 +1459,9 @@ g_raid3_start(struct bio *bp)
}
mtx_lock(&sc->sc_queue_mtx);
bioq_insert_tail(&sc->sc_queue, bp);
mtx_unlock(&sc->sc_queue_mtx);
G_RAID3_DEBUG(4, "%s: Waking up %p.", __func__, sc);
wakeup(sc);
mtx_unlock(&sc->sc_queue_mtx);
}
/*