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);
 }
 
 /*
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to