Skip to content

Commit

Permalink
Merge tag 'locking-urgent-2024-04-14' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Apr 14, 2024
2 parents c28275e + fa1f511 commit fa37b3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/linux/rwbase_rt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions include/linux/rwsem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fa37b3b

Please sign in to comment.