Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Sep 2010 20:08:46 +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-7@freebsd.org
Subject:   svn commit: r212881 - stable/7/sys/geom/raid3
Message-ID:  <201009192008.o8JK8kcg014652@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Sep 19 20:08:45 2010
New Revision: 212881
URL: http://svn.freebsd.org/changeset/base/212881

Log:
  MFC r201567:
  Move wakeup() out of mutex to reduce contention.

Modified:
  stable/7/sys/geom/raid3/g_raid3.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/raid3/g_raid3.c
==============================================================================
--- stable/7/sys/geom/raid3/g_raid3.c	Sun Sep 19 20:07:40 2010	(r212880)
+++ stable/7/sys/geom/raid3/g_raid3.c	Sun Sep 19 20:08:45 2010	(r212881)
@@ -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);
 }
 
 /*



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