Remove the now unused RWSEM_OWNER_UNKNOWN hack. This hack breaks PREEMPT_RT and getting rid of it was the entire motivation for re-writing the percpu rwsem. The biggest problem is that it is fundamentally incompatible with any form of Priority Inheritance, any exclusively held lock must have a distinct owner.
Unified · Split
| @@ -53,12 +53,6 @@ struct rw_semaphore { · 52 unmodified lines | |||
| 53 | #endif | 53 | #endif |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | /* | ||
| 57 | * Setting all bits of the owner field except bit 0 will indicate | ||
| 58 | * that the rwsem is writer-owned with an unknown owner. | ||
| 59 | */ | ||
| 60 | #define RWSEM_OWNER_UNKNOWN (-2L) | ||
| 61 | |||
| 62 | /* In all implementations count != 0 means locked */ | 56 | /* In all implementations count != 0 means locked */ |
| 63 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | 57 | static inline int rwsem_is_locked(struct rw_semaphore *sem) |
| 64 | { | 58 | { |
| @@ -659,8 +659,6 @@ static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem, · 658 unmodified lines | |||
| 659 | unsigned long flags; | 659 | unsigned long flags; |
| 660 | bool ret = true; | 660 | bool ret = true; |
| 661 | 661 | ||
| 662 | BUILD_BUG_ON(!(RWSEM_OWNER_UNKNOWN & RWSEM_NONSPINNABLE)); | ||
| 663 | |||
| 664 | if (need_resched()) { | 662 | if (need_resched()) { |
| 665 | lockevent_inc(rwsem_opt_fail); | 663 | lockevent_inc(rwsem_opt_fail); |
| 666 | return false; | 664 | return false; |