rwlock: try regular read unlock even in the hard path
Saves on turnstile trips if the lock got more readers.
This commit is contained in:
parent
4bda86983b
commit
6f29c630d9
@ -771,9 +771,9 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v
|
|||||||
turnstile_chain_lock(&rw->lock_object);
|
turnstile_chain_lock(&rw->lock_object);
|
||||||
v = RW_READ_VALUE(rw);
|
v = RW_READ_VALUE(rw);
|
||||||
retry_ts:
|
retry_ts:
|
||||||
if (__predict_false(RW_READERS(v) > 1)) {
|
if (__rw_runlock_try(rw, td, &v)) {
|
||||||
turnstile_chain_unlock(&rw->lock_object);
|
turnstile_chain_unlock(&rw->lock_object);
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
v &= (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER);
|
v &= (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER);
|
||||||
|
Loading…
Reference in New Issue
Block a user