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

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

Modified:
  stable/7/sys/kern/subr_turnstile.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/kern/subr_turnstile.c
==============================================================================
--- stable/7/sys/kern/subr_turnstile.c  Thu Mar  3 16:59:20 2011        
(r219232)
+++ stable/7/sys/kern/subr_turnstile.c  Thu Mar  3 17:04:45 2011        
(r219233)
@@ -687,8 +687,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) {
@@ -697,7 +697,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"));
_______________________________________________
[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