Skip to contentSkip to conversation

locking: fix trivial f70405afc99b RT build breakage

patchlet Mike Galbraith 2 participants 3 messages Apr 4, 2024 Locking primitives

lore
Share & tools
lore
#0 lore raw

Two trivial RT build issues arrived along with f70405afc99b: WARN_ON() being undefined as added to include/linux/rwbase_rt.h, and the wrong parameter (typo) being passed to rw_base_assert_held_write().

Fixes f70405afc99b ("locking: Add rwsem_assert_held() and rwsem_assert_held_write()")
Cc Matthew Wilcox (Oracle) <[email protected]>
---
 include/linux/rwbase_rt.h |    1 +
 include/linux/rwsem.h     |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/rwbase_rt.h +1 -0
@@ -4,6 +4,7 @@
 
 #include <linux/rtmutex.h>
 #include <linux/atomic.h>
+#include <linux/bug.h>
 
 #define READER_BIAS		(1U << 31)
 #define WRITER_BIAS		(1U << 30)
include/linux/rwsem.h +1 -1
@@ -174,7 +174,7 @@ static inline void rwsem_assert_held_nol
 
 static inline void rwsem_assert_held_write_nolockdep(const struct rw_semaphore *sem)
 {
-	rw_base_assert_held_write(sem);
+	rw_base_assert_held_write(&sem->rwbase);
 }
 
 static __always_inline int rwsem_is_contended(struct rw_semaphore *sem)
#1 lore raw
Quoted 8 lines · Mike Galbraith

Two trivial RT build issues arrived along with f70405afc99b: WARN_ON() being undefined as added to include/linux/rwbase_rt.h, and the wrong parameter (typo) being passed to rw_base_assert_held_write().

Fixes f70405afc99b ("locking: Add rwsem_assert_held() and rwsem_assert_held_write()")
Cc Matthew Wilcox (Oracle) <[email protected]>

Is Sebastian's patch not merged yet?

https://lore.kernel.org/lkml/[email protected]/

Quoted 26 lines
 include/linux/rwbase_rt.h |    1 +
 include/linux/rwsem.h     |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
include/linux/rwbase_rt.h +1 -0
@@ -4,6 +4,7 @@
 
 #include <linux/rtmutex.h>
 #include <linux/atomic.h>
+#include <linux/bug.h>
 
 #define READER_BIAS		(1U << 31)
 #define WRITER_BIAS		(1U << 30)
include/linux/rwsem.h +1 -1
@@ -174,7 +174,7 @@ static inline void rwsem_assert_held_nol
 
 static inline void rwsem_assert_held_write_nolockdep(const struct rw_semaphore *sem)
 {
-	rw_base_assert_held_write(sem);
+	rw_base_assert_held_write(&sem->rwbase);
 }
 
 static __always_inline int rwsem_is_contended(struct rw_semaphore *sem)
#2 lore raw
Quoted 6 lines · Matthew Wilcox
Quoted 5 lines · Mike Galbraith

Two trivial RT build issues arrived along with f70405afc99b: WARN_ON() being undefined as added to include/linux/rwbase_rt.h, and the wrong parameter (typo) being passed to rw_base_assert_held_write().

Quoted 7 lines
Quoted 3 lines
Fixes f70405afc99b ("locking: Add rwsem_assert_held() and rwsem_assert_held_write()")
Cc Matthew Wilcox (Oracle) <[email protected]>

Is Sebastian's patch not merged yet?

https://lore.kernel.org/lkml/[email protected]/

Ah, known issue. Neeevermind.

-Mike

Quoted 1 line