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:
Mateusz Guzik 2018-01-13 00:05:31 +00:00
parent e62fb4b142
commit 84f2a8a4b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327905

View File

@ -771,9 +771,9 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v
turnstile_chain_lock(&rw->lock_object);
v = RW_READ_VALUE(rw);
retry_ts:
if (__predict_false(RW_READERS(v) > 1)) {
if (__rw_runlock_try(rw, td, &v)) {
turnstile_chain_unlock(&rw->lock_object);
continue;
break;
}
v &= (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER);