Lines Matching refs:owner

916 	u_long owner;  in do_lock_umtx()  local
932 owner = casuword(&umtx->u_owner, UMTX_UNOWNED, id); in do_lock_umtx()
935 if (owner == UMTX_UNOWNED) in do_lock_umtx()
939 if (owner == -1) in do_lock_umtx()
943 if (owner == UMTX_CONTESTED) { in do_lock_umtx()
944 owner = casuword(&umtx->u_owner, in do_lock_umtx()
947 if (owner == UMTX_CONTESTED) in do_lock_umtx()
951 if (owner == -1) in do_lock_umtx()
985 old = casuword(&umtx->u_owner, owner, owner | UMTX_CONTESTED); in do_lock_umtx()
1002 if (old == owner) in do_lock_umtx()
1032 u_long owner; in do_unlock_umtx() local
1040 owner = fuword(__DEVOLATILE(u_long *, &umtx->u_owner)); in do_unlock_umtx()
1041 if (owner == -1) in do_unlock_umtx()
1044 if ((owner & ~UMTX_CONTESTED) != id) in do_unlock_umtx()
1048 if ((owner & UMTX_CONTESTED) == 0) { in do_unlock_umtx()
1049 old = casuword(&umtx->u_owner, owner, UMTX_UNOWNED); in do_unlock_umtx()
1052 if (old == owner) in do_unlock_umtx()
1054 owner = old; in do_unlock_umtx()
1072 old = casuword(&umtx->u_owner, owner, in do_unlock_umtx()
1081 if (old != owner) in do_unlock_umtx()
1097 uint32_t owner; in do_lock_umtx32() local
1114 owner = casuword32(m, UMUTEX_UNOWNED, id); in do_lock_umtx32()
1117 if (owner == UMUTEX_UNOWNED) in do_lock_umtx32()
1121 if (owner == -1) in do_lock_umtx32()
1125 if (owner == UMUTEX_CONTESTED) { in do_lock_umtx32()
1126 owner = casuword32(m, in do_lock_umtx32()
1128 if (owner == UMUTEX_CONTESTED) in do_lock_umtx32()
1132 if (owner == -1) in do_lock_umtx32()
1166 old = casuword32(m, owner, owner | UMUTEX_CONTESTED); in do_lock_umtx32()
1183 if (old == owner) in do_lock_umtx32()
1213 uint32_t owner; in do_unlock_umtx32() local
1221 owner = fuword32(m); in do_unlock_umtx32()
1222 if (owner == -1) in do_unlock_umtx32()
1225 if ((owner & ~UMUTEX_CONTESTED) != id) in do_unlock_umtx32()
1229 if ((owner & UMUTEX_CONTESTED) == 0) { in do_unlock_umtx32()
1230 old = casuword32(m, owner, UMUTEX_UNOWNED); in do_unlock_umtx32()
1233 if (old == owner) in do_unlock_umtx32()
1235 owner = old; in do_unlock_umtx32()
1253 old = casuword32(m, owner, in do_unlock_umtx32()
1262 if (old != owner) in do_unlock_umtx32()
1351 uint32_t owner, old, id; in do_lock_normal() local
1365 rv = fueword32(&m->m_owner, &owner); in do_lock_normal()
1369 if (owner == UMUTEX_UNOWNED || in do_lock_normal()
1370 owner == UMUTEX_CONTESTED || in do_lock_normal()
1371 owner == UMUTEX_RB_OWNERDEAD || in do_lock_normal()
1372 owner == UMUTEX_RB_NOTRECOV) in do_lock_normal()
1381 if (owner == UMUTEX_RB_OWNERDEAD) { in do_lock_normal()
1383 UMUTEX_RB_OWNERDEAD, &owner, in do_lock_normal()
1388 MPASS(owner == UMUTEX_RB_OWNERDEAD); in do_lock_normal()
1397 if (owner == UMUTEX_RB_NOTRECOV) in do_lock_normal()
1405 &owner, id); in do_lock_normal()
1412 MPASS(owner == UMUTEX_UNOWNED); in do_lock_normal()
1421 if (owner == UMUTEX_CONTESTED) { in do_lock_normal()
1423 UMUTEX_CONTESTED, &owner, in do_lock_normal()
1429 MPASS(owner == UMUTEX_CONTESTED); in do_lock_normal()
1476 rv = casueword32(&m->m_owner, owner, &old, in do_lock_normal()
1477 owner | UMUTEX_CONTESTED); in do_lock_normal()
1503 MPASS(old == owner); in do_lock_normal()
1524 uint32_t owner, old, id, newlock; in do_unlock_normal() local
1533 error = fueword32(&m->m_owner, &owner); in do_unlock_normal()
1537 if ((owner & ~UMUTEX_CONTESTED) != id) in do_unlock_normal()
1541 if ((owner & UMUTEX_CONTESTED) == 0) { in do_unlock_normal()
1542 error = casueword32(&m->m_owner, owner, &old, newlock); in do_unlock_normal()
1551 MPASS(old == owner); in do_unlock_normal()
1572 error = casueword32(&m->m_owner, owner, &old, newlock); in do_unlock_normal()
1581 if (old != owner) in do_unlock_normal()
1599 uint32_t owner; in do_wake_umutex() local
1605 error = fueword32(&m->m_owner, &owner); in do_wake_umutex()
1609 if ((owner & ~UMUTEX_CONTESTED) != 0 && owner != UMUTEX_RB_OWNERDEAD && in do_wake_umutex()
1610 owner != UMUTEX_RB_NOTRECOV) in do_wake_umutex()
1627 if (count <= 1 && owner != UMUTEX_RB_OWNERDEAD && in do_wake_umutex()
1628 owner != UMUTEX_RB_NOTRECOV) { in do_wake_umutex()
1629 error = casueword32(&m->m_owner, UMUTEX_CONTESTED, &owner, in do_wake_umutex()
1647 MPASS((owner & ~UMUTEX_CONTESTED) == 0 || in do_wake_umutex()
1648 owner == UMUTEX_RB_OWNERDEAD || in do_wake_umutex()
1649 owner == UMUTEX_RB_NOTRECOV); in do_wake_umutex()
1665 uint32_t owner, old; in do_wake2_umutex() local
1694 owner = 0; in do_wake2_umutex()
1700 error = fueword32(&m->m_owner, &owner); in do_wake2_umutex()
1709 while (error == 0 && (owner & UMUTEX_CONTESTED) == 0 && in do_wake2_umutex()
1710 (count > 1 || (count == 1 && (owner & ~UMUTEX_CONTESTED) != 0))) { in do_wake2_umutex()
1711 error = casueword32(&m->m_owner, owner, &old, in do_wake2_umutex()
1712 owner | UMUTEX_CONTESTED); in do_wake2_umutex()
1718 MPASS(old == owner); in do_wake2_umutex()
1721 owner = old; in do_wake2_umutex()
1728 } else if (count != 0 && ((owner & ~UMUTEX_CONTESTED) == 0 || in do_wake2_umutex()
1729 owner == UMUTEX_RB_OWNERDEAD || owner == UMUTEX_RB_NOTRECOV)) in do_wake2_umutex()
1931 umtx_pi_setowner(struct umtx_pi *pi, struct thread *owner) in umtx_pi_setowner() argument
1935 uq_owner = owner->td_umtxq; in umtx_pi_setowner()
1938 pi->pi_owner = owner; in umtx_pi_setowner()
1958 umtx_pi_claim(struct umtx_pi *pi, struct thread *owner) in umtx_pi_claim() argument
1964 if (pi->pi_owner == owner) { in umtx_pi_claim()
1976 umtx_pi_setowner(pi, owner); in umtx_pi_claim()
1980 thread_lock(owner); in umtx_pi_claim()
1981 if (pri < UPRI(owner)) in umtx_pi_claim()
1982 sched_lend_user_prio(owner, pri); in umtx_pi_claim()
1983 thread_unlock(owner); in umtx_pi_claim()
2016 umtxq_sleep_pi(struct umtx_q *uq, struct umtx_pi *pi, uint32_t owner, in umtxq_sleep_pi() argument
2036 td1 = tdfind(owner, shared ? -1 : td->td_proc->p_pid); in umtxq_sleep_pi()
2225 uint32_t id, old_owner, owner, old; in do_lock_pi() local
2270 rv = casueword32(&m->m_owner, UMUTEX_UNOWNED, &owner, id); in do_lock_pi()
2278 MPASS(owner == UMUTEX_UNOWNED); in do_lock_pi()
2283 if (owner == UMUTEX_RB_NOTRECOV) { in do_lock_pi()
2292 if (owner == UMUTEX_UNOWNED) { in do_lock_pi()
2310 if (owner == UMUTEX_CONTESTED || owner == UMUTEX_RB_OWNERDEAD) { in do_lock_pi()
2311 old_owner = owner; in do_lock_pi()
2312 rv = casueword32(&m->m_owner, owner, &owner, in do_lock_pi()
2334 MPASS(owner == old_owner); in do_lock_pi()
2355 if ((owner & ~UMUTEX_CONTESTED) == id) { in do_lock_pi()
2382 rv = casueword32(&m->m_owner, owner, &old, owner | in do_lock_pi()
2409 MPASS(old == owner); in do_lock_pi()
2410 error = umtxq_sleep_pi(uq, pi, owner & ~UMUTEX_CONTESTED, in do_lock_pi()
2436 uint32_t id, new_owner, old, owner; in do_unlock_pi() local
2445 error = fueword32(&m->m_owner, &owner); in do_unlock_pi()
2449 if ((owner & ~UMUTEX_CONTESTED) != id) in do_unlock_pi()
2455 if ((owner & UMUTEX_CONTESTED) == 0) { in do_unlock_pi()
2456 error = casueword32(&m->m_owner, owner, &old, new_owner); in do_unlock_pi()
2465 if (old == owner) in do_unlock_pi()
2467 owner = old; in do_unlock_pi()
2497 error = casueword32(&m->m_owner, owner, &old, new_owner); in do_unlock_pi()
2507 if (error == 0 && old != owner) in do_unlock_pi()
2523 uint32_t owner, id; in do_lock_pp() local
2572 rv = casueword32(&m->m_owner, UMUTEX_CONTESTED, &owner, in do_lock_pp()
2580 MPASS(owner == UMUTEX_CONTESTED); in do_lock_pp()
2585 if (owner == UMUTEX_RB_OWNERDEAD) { in do_lock_pp()
2587 &owner, id | UMUTEX_CONTESTED); in do_lock_pp()
2593 MPASS(owner == UMUTEX_RB_OWNERDEAD); in do_lock_pp()
2614 } else if (owner == UMUTEX_RB_NOTRECOV) { in do_lock_pp()
2688 uint32_t id, owner, rceiling; in do_unlock_pp() local
2699 error = fueword32(&m->m_owner, &owner); in do_unlock_pp()
2703 if ((owner & ~UMUTEX_CONTESTED) != id) in do_unlock_pp()
2771 uint32_t flags, id, owner, save_ceiling; in do_set_ceiling() local
2798 rv = casueword32(&m->m_owner, UMUTEX_CONTESTED, &owner, in do_set_ceiling()
2806 MPASS(owner == UMUTEX_CONTESTED); in do_set_ceiling()
2813 if ((owner & ~UMUTEX_CONTESTED) == id) { in do_set_ceiling()
2819 if (owner == UMUTEX_RB_OWNERDEAD) { in do_set_ceiling()
2822 } else if (owner == UMUTEX_RB_NOTRECOV) { in do_set_ceiling()