Commit fa37b3be authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'locking-urgent-2024-04-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fix from Ingo Molnar:
 "Fix a PREEMPT_RT build bug"

* tag 'locking-urgent-2024-04-14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking: Make rwsem_assert_held_write_nolockdep() build with PREEMPT_RT=y
parents c28275e7 fa1f5116
......@@ -31,9 +31,9 @@ static __always_inline bool rw_base_is_locked(const struct rwbase_rt *rwb)
return atomic_read(&rwb->readers) != READER_BIAS;
}
static inline void rw_base_assert_held_write(const struct rwbase_rt *rwb)
static __always_inline bool rw_base_is_write_locked(const struct rwbase_rt *rwb)
{
WARN_ON(atomic_read(&rwb->readers) != WRITER_BIAS);
return atomic_read(&rwb->readers) == WRITER_BIAS;
}
static __always_inline bool rw_base_is_contended(const struct rwbase_rt *rwb)
......
......@@ -167,14 +167,14 @@ static __always_inline int rwsem_is_locked(const struct rw_semaphore *sem)
return rw_base_is_locked(&sem->rwbase);
}
static inline void rwsem_assert_held_nolockdep(const struct rw_semaphore *sem)
static __always_inline void rwsem_assert_held_nolockdep(const struct rw_semaphore *sem)
{
WARN_ON(!rwsem_is_locked(sem));
}
static inline void rwsem_assert_held_write_nolockdep(const struct rw_semaphore *sem)
static __always_inline void rwsem_assert_held_write_nolockdep(const struct rw_semaphore *sem)
{
rw_base_assert_held_write(sem);
WARN_ON(!rw_base_is_write_locked(&sem->rwbase));
}
static __always_inline int rwsem_is_contended(struct rw_semaphore *sem)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment