Skip to content

Commit

Permalink
locking/rwsem: Remove RWSEM_OWNER_UNKNOWN
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Feb 11, 2020
1 parent 7f26482 commit bcba67c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
6 changes: 0 additions & 6 deletions include/linux/rwsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ struct rw_semaphore {
#endif
};

/*
* Setting all bits of the owner field except bit 0 will indicate
* that the rwsem is writer-owned with an unknown owner.
*/
#define RWSEM_OWNER_UNKNOWN (-2L)

/* In all implementations count != 0 means locked */
static inline int rwsem_is_locked(struct rw_semaphore *sem)
{
Expand Down
2 changes: 0 additions & 2 deletions kernel/locking/rwsem.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,6 @@ static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem,
unsigned long flags;
bool ret = true;

BUILD_BUG_ON(!(RWSEM_OWNER_UNKNOWN & RWSEM_NONSPINNABLE));

if (need_resched()) {
lockevent_inc(rwsem_opt_fail);
return false;
Expand Down

0 comments on commit bcba67c

Please sign in to comment.