Skip to content

Commit bcba67c

Browse files
Peter Zijlstraingomolnar
authored andcommitted
locking/rwsem: Remove RWSEM_OWNER_UNKNOWN
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. Requested-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Davidlohr Bueso <dbueso@suse.de> Acked-by: Will Deacon <will@kernel.org> Acked-by: Waiman Long <longman@redhat.com> Tested-by: Juri Lelli <juri.lelli@redhat.com> Link: https://lkml.kernel.org/r/20200204092228.GP14946@hirez.programming.kicks-ass.net
1 parent 7f26482 commit bcba67c

2 files changed

Lines changed: 0 additions & 8 deletions

File tree

‎include/linux/rwsem.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ struct rw_semaphore {
5353
#endif
5454
};
5555

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-
6256
/* In all implementations count != 0 means locked */
6357
static inline int rwsem_is_locked(struct rw_semaphore *sem)
6458
{

‎kernel/locking/rwsem.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,6 @@ static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem,
659659
unsigned long flags;
660660
bool ret = true;
661661

662-
BUILD_BUG_ON(!(RWSEM_OWNER_UNKNOWN & RWSEM_NONSPINNABLE));
663-
664662
if (need_resched()) {
665663
lockevent_inc(rwsem_opt_fail);
666664
return false;

0 commit comments

Comments
 (0)