Page MenuHomeFreeBSD

D49031.id151110.diff
No OneTemporary

D49031.id151110.diff

diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -2542,6 +2542,7 @@
old_inherited_pri = uq->uq_inherited_pri;
umtxq_lock(&uq->uq_key);
umtxq_busy(&uq->uq_key);
+ umtxq_insert(uq);
umtxq_unlock(&uq->uq_key);
rv = fueword32(&m->m_ceilings[0], &ceiling);
@@ -2609,10 +2610,12 @@
if (error == 0) {
error = thread_check_susp(td, false);
if (error == 0 && try == 0) {
- umtxq_unbusy_unlocked(&uq->uq_key);
+ umtxq_lock(&uq->uq_key);
+ umtxq_remove(uq);
+ umtxq_unbusy(&uq->uq_key);
+ umtxq_unlock(&uq->uq_key);
continue;
}
- error = 0;
}
} else if (owner == UMUTEX_RB_NOTRECOV) {
error = ENOTRECOVERABLE;
@@ -2628,8 +2631,18 @@
if (error != 0)
break;
+ /*
+ * We may have gotten a spurious failure.
+ */
+ if (owner == UMUTEX_CONTESTED) {
+ umtxq_lock(&uq->uq_key);
+ umtxq_remove(uq);
+ umtxq_unbusy(&uq->uq_key);
+ umtxq_unlock(&uq->uq_key);
+ continue;
+ }
+
umtxq_lock(&uq->uq_key);
- umtxq_insert(uq);
umtxq_unbusy(&uq->uq_key);
error = umtxq_sleep(uq, "umtxpp", timeout == NULL ?
NULL : &timo);
@@ -2674,7 +2687,10 @@
}
out:
- umtxq_unbusy_unlocked(&uq->uq_key);
+ umtxq_lock(&uq->uq_key);
+ umtxq_unbusy(&uq->uq_key);
+ umtxq_remove(uq);
+ umtxq_unlock(&uq->uq_key);
umtx_key_release(&uq->uq_key);
return (error);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 9, 2:34 AM (20 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28527075
Default Alt Text
D49031.id151110.diff (1 KB)

Event Timeline