svn commit: r212874 - stable/7/sys/geom/mirror
Alexander Motin
mav at FreeBSD.org
Sun Sep 19 19:43:05 UTC 2010
Author: mav
Date: Sun Sep 19 19:43:05 2010
New Revision: 212874
URL: http://svn.freebsd.org/changeset/base/212874
Log:
MFC r201566:
Move wakeup() out of mutex to reduce contention.
Modified:
stable/7/sys/geom/mirror/g_mirror.c
Directory Properties:
stable/7/sys/ (props changed)
stable/7/sys/cddl/contrib/opensolaris/ (props changed)
stable/7/sys/contrib/dev/acpica/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
Modified: stable/7/sys/geom/mirror/g_mirror.c
==============================================================================
--- stable/7/sys/geom/mirror/g_mirror.c Sun Sep 19 19:42:04 2010 (r212873)
+++ stable/7/sys/geom/mirror/g_mirror.c Sun Sep 19 19:43:05 2010 (r212874)
@@ -853,8 +853,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
@@ -939,9 +939,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:
@@ -979,8 +979,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
@@ -1092,9 +1092,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);
}
/*
More information about the svn-src-stable-7
mailing list