summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mutex.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2009-05-29 14:03:34 +0000
committerjhb <jhb@FreeBSD.org>2009-05-29 14:03:34 +0000
commit9f31bca4359737a90e8665b4e0a41bbed9edad74 (patch)
tree7e9c09c962ce8c51b7ba4cd086e5c5c53707cada /sys/kern/kern_mutex.c
parentcdcee493a206829c1a3ccc94df157c9720285eb7 (diff)
downloadFreeBSD-src-9f31bca4359737a90e8665b4e0a41bbed9edad74.zip
FreeBSD-src-9f31bca4359737a90e8665b4e0a41bbed9edad74.tar.gz
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
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r--sys/kern/kern_mutex.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 17c72eb..fc342c5 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -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;
}
OpenPOWER on IntegriCloud