Revert "locking, x86, tsx: Switch stateful rwsem to late lock check" This reverts commit 3fe09a2de2eb2ce19c56e505ae0d2463963de878.
diff --git a/arch/x86/include/asm/rwsem.h b/arch/x86/include/asm/rwsem.h index 4a2a99e..9573894 100644 --- a/arch/x86/include/asm/rwsem.h +++ b/arch/x86/include/asm/rwsem.h
@@ -92,13 +92,12 @@ static inline void __down_read_state(struct rw_semaphore *sem, int *state) { if (elide_lock_adapt(rwsem_elision, - 1, + sem->count < RWSEM_ACTIVE_WRITE_BIAS, &sem->elision_adapt, &readsem_elision_config)) { *state = 1; return; } - *state = 0; ___down_read(sem); } @@ -141,8 +140,7 @@ static inline int __down_read_trylock_state(struct rw_semaphore *sem, int *state) { - if (elide_lock_adapt(rwsem_elision, - 1, + if (elide_lock_adapt(rwsem_elision, sem->count < RWSEM_ACTIVE_WRITE_BIAS, &sem->elision_adapt, &readsem_elision_config)) { *state = 1; @@ -240,11 +238,7 @@ static inline void __up_read_state(struct rw_semaphore *sem, int state) { - /* - * Late lock check. This limits the conflict overlap window - * with locking readers changing the count. - */ - if (elide_unlock_check(state, sem->count < RWSEM_ACTIVE_WRITE_BIAS)) + if (elide_unlock(state != 0)) return; ___up_read(sem); }