Remove extra cpu_spinwait() invocations. This should really only be used

in tight spin loops, not in these edge cases where we restart a much
larger loop only a few times.

Reviewed by:	attilio
This commit is contained in:
John Baldwin 2009-05-29 14:03:34 +00:00
parent fa29f0236f
commit a571ad41ae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=193037
2 changed files with 0 additions and 11 deletions

View File

@ -393,7 +393,6 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t tid, int opts, const char *file,
*/
if (v == MTX_UNOWNED) {
turnstile_cancel(ts);
cpu_spinwait();
continue;
}
@ -408,7 +407,6 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t tid, int opts, const char *file,
owner = (struct thread *)(v & ~MTX_FLAGMASK);
if (TD_IS_RUNNING(owner)) {
turnstile_cancel(ts);
cpu_spinwait();
continue;
}
#endif
@ -421,7 +419,6 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t tid, int opts, const char *file,
if ((v & MTX_CONTESTED) == 0 &&
!atomic_cmpset_ptr(&m->mtx_lock, v, v | MTX_CONTESTED)) {
turnstile_cancel(ts);
cpu_spinwait();
continue;
}

View File

@ -350,7 +350,6 @@ _rw_rlock(struct rwlock *rw, const char *file, int line)
(void *)(v + RW_ONE_READER));
break;
}
cpu_spinwait();
continue;
}
lock_profile_obtain_lock_failed(&rw->lock_object,
@ -406,7 +405,6 @@ _rw_rlock(struct rwlock *rw, const char *file, int line)
v = rw->rw_lock;
if (RW_CAN_READ(v)) {
turnstile_cancel(ts);
cpu_spinwait();
continue;
}
@ -422,7 +420,6 @@ _rw_rlock(struct rwlock *rw, const char *file, int line)
owner = (struct thread *)RW_OWNER(v);
if (TD_IS_RUNNING(owner)) {
turnstile_cancel(ts);
cpu_spinwait();
continue;
}
}
@ -443,7 +440,6 @@ _rw_rlock(struct rwlock *rw, const char *file, int line)
if (!atomic_cmpset_ptr(&rw->rw_lock, v,
v | RW_LOCK_READ_WAITERS)) {
turnstile_cancel(ts);
cpu_spinwait();
continue;
}
if (LOCK_LOG_TEST(&rw->lock_object, 0))
@ -695,7 +691,6 @@ _rw_wlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, int line)
if (!(v & RW_LOCK_WRITE_SPINNER)) {
if (!atomic_cmpset_ptr(&rw->rw_lock, v,
v | RW_LOCK_WRITE_SPINNER)) {
cpu_spinwait();
continue;
}
}
@ -727,7 +722,6 @@ _rw_wlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, int line)
owner = (struct thread *)RW_OWNER(v);
if (TD_IS_RUNNING(owner)) {
turnstile_cancel(ts);
cpu_spinwait();
continue;
}
}
@ -750,7 +744,6 @@ _rw_wlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, int line)
break;
}
turnstile_cancel(ts);
cpu_spinwait();
continue;
}
/*
@ -762,7 +755,6 @@ _rw_wlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, int line)
if (!atomic_cmpset_ptr(&rw->rw_lock, v,
v | RW_LOCK_WRITE_WAITERS)) {
turnstile_cancel(ts);
cpu_spinwait();
continue;
}
if (LOCK_LOG_TEST(&rw->lock_object, 0))