svn commit: r219234 - stable/8/sys/kern

John Baldwin jhb at FreeBSD.org
Thu Mar 3 17:04:58 UTC 2011


Author: jhb
Date: Thu Mar  3 17:04:57 2011
New Revision: 219234
URL: http://svn.freebsd.org/changeset/base/219234

Log:
  MFC 200761,218272:
  Always assert that the turnstile chain lock is held in turnstile_wait()
  and remove a duplicate hash lookup.

Modified:
  stable/8/sys/kern/subr_turnstile.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/kern/subr_turnstile.c
==============================================================================
--- stable/8/sys/kern/subr_turnstile.c	Thu Mar  3 17:04:45 2011	(r219233)
+++ stable/8/sys/kern/subr_turnstile.c	Thu Mar  3 17:04:57 2011	(r219234)
@@ -685,8 +685,8 @@ turnstile_wait(struct turnstile *ts, str
 	 * turnstile already in use by this lock.
 	 */
 	tc = TC_LOOKUP(ts->ts_lockobj);
-	if (ts == td->td_turnstile) {
 	mtx_assert(&tc->tc_lock, MA_OWNED);
+	if (ts == td->td_turnstile) {
 #ifdef TURNSTILE_PROFILING
 		tc->tc_depth++;
 		if (tc->tc_depth > tc->tc_max_depth) {
@@ -695,7 +695,6 @@ turnstile_wait(struct turnstile *ts, str
 				turnstile_max_depth = tc->tc_max_depth;
 		}
 #endif
-		tc = TC_LOOKUP(ts->ts_lockobj);
 		LIST_INSERT_HEAD(&tc->tc_turnstiles, ts, ts_hash);
 		KASSERT(TAILQ_EMPTY(&ts->ts_pending),
 		    ("thread's turnstile has pending threads"));


More information about the svn-src-stable mailing list