rcu: include rtmutex_common.h in tree_stall.h
PATCH 1/1 rcu: include rtmutex_common.h in tree_stall.h
From: Arnd Bergmann <[email protected]>
The added call to rt_mutex_owner() makes this fail to build in some configurations:
In file included from kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function 'rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex) == t)
| ^kernel/rcu/tree_stall.h:333:48: error: comparison between pointer and integer ('int' and 'struct task_struct *') [-Werror,-Wpointer-integer-compare]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex) == t)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
In file included from kernel/rcu/tree.c:5124:
In file included from kernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflicting types for 'rt_mutex_owner'
231 | static inline struct task_struct *rt_mutex_owner(struct rt_mutex_base *lock)
| ^kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration is here
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex) == t)
| ^
There are already a couple of inclusions of "../locking/rtmutex_common.h", so assume this is safe to do here.
---
I wonder if it would be better to either move the rt_mutex_owner() definition into a global header like include/linux/rtmutex.h, or to move the code out of tree_stall.h into a .c file, as this feels like a layering violation.
--- kernel/rcu/tree_stall.h | 1 + 1 file changed, 1 insertion(+)
kernel/rcu/tree_stall.h +1 -0
@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" ////////////////////////////////////////////////////////////////////////////// //
Signature · 1 line
2.53.0
Quoted 26 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The added call to
rt_mutex_owner()makes this fail to build in some configurations:In file included from
kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function 'rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^kernel/rcu/tree_stall.h:333:48: error: comparison between pointer and integer ('int' and 'structtask_struct*') [-Werror,-Wpointer-integer-compare]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~In file included from
kernel/rcu/tree.c:5124:
In file included fromkernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflicting types for 'rt_mutex_owner'
231 | static inline structtask_struct*rt_mutex_owner(structrt_mutex_base*lock)
| ^kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration is here
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^
Quoted 5 lines
There are already a couple of inclusions of "
../locking/rtmutex_common.h", so assume this is safe to do here.Fixes 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU task stall dump")Signed-off-by Arnd Bergmann <[email protected]>
Looks "ok"
Perhaps Paul could suggest another alternative M
Quoted 15 lines
---
I wonder if it would be better to either move thert_mutex_owner()definition into a global header likeinclude/linux/rtmutex.h, or to move the code out oftree_stall.hinto a .c file, as this feels like a layering violation.
---kernel/rcu/tree_stall.h| 1 +1 file changed, 1 insertion(+)kernel/rcu/tree_stall.h +0
-0
kernel/rcu/tree_stall.h line 18
Quoted 7 lines
kernel/rcu/tree_stall.h +1
-0@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" ////////////////////////////////////////////////////////////////////////////// //
--- Thanks!
"I'm not a very positive person" - Linus torvalds
Thanks, Arnd.
Tested on top of 1eccf02fb8d5 with CONFIG_PREEMPT_RCU=y:
CONFIG_RT_MUTEXES=y: build passes CONFIG_RT_MUTEXES=n: fails without this patch, passes with it
The failure is in tree_stall.h, where rt_mutex_owner() is used before tree_plugin.h includes rtmutex_common.h. This matches the reported failure, and the added include fixes it.
Thanks,
Kunwu
Quoted 51 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The added call to
rt_mutex_owner()makes this fail to build in some configurations:In file included from
kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function 'rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^kernel/rcu/tree_stall.h:333:48: error: comparison between pointer and integer ('int' and 'structtask_struct*') [-Werror,-Wpointer-integer-compare]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~In file included from
kernel/rcu/tree.c:5124:
In file included fromkernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflicting types for 'rt_mutex_owner'
231 | static inline structtask_struct*rt_mutex_owner(structrt_mutex_base*lock)
| ^kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration is here
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^There are already a couple of inclusions of "
../locking/rtmutex_common.h", so assume this is safe to do here.Fixes 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU task stall dump")Signed-off-by Arnd Bergmann <[email protected]>---
I wonder if it would be better to either move thert_mutex_owner()definition into a global header likeinclude/linux/rtmutex.h, or to move the code out oftree_stall.hinto a .c file, as this feels like a layering violation.--- kernel/rcu/tree_stall.h | 1 + 1 file changed, 1 insertion(+)kernel/rcu/tree_stall.h +1
-1@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" ////////////////////////////////////////////////////////////////////////////// // --2.53.0
Paul E. McKenney
maintainerQuoted 7 lines · KunWu Chan
Thanks, Arnd.
Tested on top of
1eccf02fb8d5withCONFIG_PREEMPT_RCU=y:
CONFIG_RT_MUTEXES=y: build passesCONFIG_RT_MUTEXES=n: fails without this patch, passes with it
Quoted 6 lines
The failure is in
tree_stall.h, wherert_mutex_owner()is used beforetree_plugin.hincludesrtmutex_common.h. This matches the reported failure, and the added include fixes it.Reviewed-by Kunwu Chan <[email protected]>Tested-by Kunwu Chan <[email protected]>
Bradley and Kunwu, are you OK with my applying your tags to the commit that I am merging this into?
1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU task stall dump")
Thanx, Paul
Quoted 56 lines
Thanks,
KunwuQuoted 51 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The added call to
rt_mutex_owner()makes this fail to build in some configurations:In file included from
kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function 'rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^kernel/rcu/tree_stall.h:333:48: error: comparison between pointer and integer ('int' and 'structtask_struct*') [-Werror,-Wpointer-integer-compare]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~In file included from
kernel/rcu/tree.c:5124:
In file included fromkernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflicting types for 'rt_mutex_owner'
231 | static inline structtask_struct*rt_mutex_owner(structrt_mutex_base*lock)
| ^kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration is here
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^There are already a couple of inclusions of "
../locking/rtmutex_common.h", so assume this is safe to do here.Fixes 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU task stall dump")Signed-off-by Arnd Bergmann <[email protected]>---
I wonder if it would be better to either move thert_mutex_owner()definition into a global header likeinclude/linux/rtmutex.h, or to move the code out oftree_stall.hinto a .c file, as this feels like a layering violation.--- kernel/rcu/tree_stall.h | 1 + 1 file changed, 1 insertion(+)kernel/rcu/tree_stall.h +1
-1@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" ////////////////////////////////////////////////////////////////////////////// // --2.53.0
Quoted 12 lines · Paul E. McKenney
Quoted 11 lines · KunWu Chan
Thanks, Arnd.
Tested on top of
1eccf02fb8d5withCONFIG_PREEMPT_RCU=y:
CONFIG_RT_MUTEXES=y: build passesCONFIG_RT_MUTEXES=n: fails without this patch, passes with itThe failure is in
tree_stall.h, wherert_mutex_owner()is used beforetree_plugin.hincludesrtmutex_common.h. This matches the reported failure, and the added include fixes it.
Quoted 9 lines
Quoted 2 lines
Reviewed-by Kunwu Chan <[email protected]>Tested-by Kunwu Chan <[email protected]>Bradley and Kunwu, are you OK with my applying your tags to the commit that I am merging this into?
1eccf02fb8d5("rcu: Add running and boosted indications to RCU task stall dump")
I'm ok with it
Quoted 55 lines
Thanx, Paul
Quoted 12 lines
Thanks,
KunwuQuoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The added call to
rt_mutex_owner()makes this fail to build in some configurations:In file included from
kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function'
rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]Quoted 1 line
Quoted 1 line
333 | if
(
rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)Quoted 2 lines
Quoted 2 lines
| ^
kernel/rcu/tree_stall.h:333:48: error: comparison between pointer andinteger ('int' and 'struct
task_struct*')
[-Werror,-Wpointer-integer-compare]Quoted 1 line
Quoted 1 line
333 | if
(
rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)Quoted 1 line
Quoted 1 line
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Quoted 3 lines
Quoted 3 lines
In file included from
kernel/rcu/tree.c:5124:
In file included fromkernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflictingtypes for '
rt_mutex_owner'Quoted 1 line
Quoted 1 line
231 | static inline struct
task_struct*rt_mutex_owner(struct
rt_mutex_base*lock)Quoted 2 lines
Quoted 2 lines
| ^
kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration ishere
Quoted 1 line
Quoted 1 line
333 | if
(
rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)Quoted 3 lines
Quoted 3 lines
| ^
There are already a couple of inclusions of
"
../locking/rtmutex_common.h",Quoted 3 lines
Quoted 3 lines
so assume this is safe to do here.
Fixes 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCUtask stall dump")
Quoted 10 lines
Quoted 10 lines
Signed-off-by Arnd Bergmann <[email protected]>---
I wonder if it would be better to either move thert_mutex_owner()definition into a global header likeinclude/linux/rtmutex.h, or to move the code out oftree_stall.hinto a .c file, as this feels like a layering violation.--- kernel/rcu/tree_stall.h | 1 + 1 file changed, 1 insertion(+)
Quoted 19 lines
Quoted 11 lines
kernel/rcu/tree_stall.h line 17
Quoted 11 lines
kernel/rcu/tree_stall.h +1
-0@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" //////////////////////////////////////////////////////////////////////////////
Quoted 5 lines
Quoted 4 lines
kernel/rcu/tree_stall.h +0
-1// --2.53.0
--- Thanks!
"I'm not a very positive person" - Linus torvalds
Paul E. McKenney
maintainerQuoted 17 lines · Bradley Morgan
Quoted 15 lines · Paul E. McKenney
Quoted 13 lines · KunWu Chan
Thanks, Arnd.
Tested on top of
1eccf02fb8d5withCONFIG_PREEMPT_RCU=y:
CONFIG_RT_MUTEXES=y: build passesCONFIG_RT_MUTEXES=n: fails without this patch, passes with itThe failure is in
tree_stall.h, wherert_mutex_owner()is used beforetree_plugin.hincludesrtmutex_common.h. This matches the reported failure, and the added include fixes it.Reviewed-by Kunwu Chan <[email protected]>Tested-by Kunwu Chan <[email protected]>
Quoted 7 lines
Quoted 5 lines
Bradley and Kunwu, are you OK with my applying your tags to the commit that I am merging this into?
1eccf02fb8d5("rcu: Add running and boosted indications to RCU task stall dump")I'm ok with it
Thank you, queued up for my next rebase.
Thanx, Paul
Quoted 75 lines
Quoted 53 lines
Quoted 12 lines
Thanks,
KunwuQuoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The added call to
rt_mutex_owner()makes this fail to build in some configurations:In file included from
kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function'
rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]Quoted 1 line
Quoted 1 line
333 | if
(
rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)Quoted 2 lines
Quoted 2 lines
| ^
kernel/rcu/tree_stall.h:333:48: error: comparison between pointer andinteger ('int' and 'struct
task_struct*')
[-Werror,-Wpointer-integer-compare]Quoted 1 line
Quoted 1 line
333 | if
(
rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)Quoted 1 line
Quoted 1 line
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
Quoted 3 lines
Quoted 3 lines
In file included from
kernel/rcu/tree.c:5124:
In file included fromkernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflictingtypes for '
rt_mutex_owner'Quoted 1 line
Quoted 1 line
231 | static inline struct
task_struct*rt_mutex_owner(struct
rt_mutex_base*lock)Quoted 2 lines
Quoted 2 lines
| ^
kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration ishere
Quoted 1 line
Quoted 1 line
333 | if
(
rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)Quoted 3 lines
Quoted 3 lines
| ^
There are already a couple of inclusions of
"
../locking/rtmutex_common.h",Quoted 3 lines
Quoted 3 lines
so assume this is safe to do here.
Fixes 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCUtask stall dump")
Quoted 10 lines
Quoted 10 lines
Signed-off-by Arnd Bergmann <[email protected]>---
I wonder if it would be better to either move thert_mutex_owner()definition into a global header likeinclude/linux/rtmutex.h, or to move the code out oftree_stall.hinto a .c file, as this feels like a layering violation.--- kernel/rcu/tree_stall.h | 1 + 1 file changed, 1 insertion(+)Quoted 19 lines
Quoted 11 lines
kernel/rcu/tree_stall.h line 17
Quoted 11 lines
kernel/rcu/tree_stall.h +1
-0@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" //////////////////////////////////////////////////////////////////////////////
Quoted 5 lines
Quoted 4 lines
kernel/rcu/tree_stall.h +0
-1// --2.53.0
--- Thanks!
"I'm not a very positive person" - Linus torvalds
Quoted 16 lines · Paul E. McKenney
Quoted 7 lines · KunWu Chan
Thanks, Arnd.
Tested on top of
1eccf02fb8d5withCONFIG_PREEMPT_RCU=y:
CONFIG_RT_MUTEXES=y: build passesCONFIG_RT_MUTEXES=n: fails without this patch, passes with itQuoted 6 lines
The failure is in
tree_stall.h, wherert_mutex_owner()is used beforetree_plugin.hincludesrtmutex_common.h. This matches the reported failure, and the added include fixes it.Reviewed-by Kunwu Chan <[email protected]>Tested-by Kunwu Chan <[email protected]>
Quoted 7 lines
Bradley and Kunwu, are you OK with my applying your tags to the commit that I am merging this into?
1eccf02fb8d5("rcu: Add running and boosted indications to RCU task stall dump")Thanx, Paul
Sure. Thanks, Paul.
Kunwu
Quoted 56 lines
Quoted 56 lines
Thanks,
KunwuQuoted 51 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The added call to
rt_mutex_owner()makes this fail to build in some configurations:In file included from
kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function 'rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^kernel/rcu/tree_stall.h:333:48: error: comparison between pointer and integer ('int' and 'structtask_struct*') [-Werror,-Wpointer-integer-compare]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~In file included from
kernel/rcu/tree.c:5124:
In file included fromkernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflicting types for 'rt_mutex_owner'
231 | static inline structtask_struct*rt_mutex_owner(structrt_mutex_base*lock)
| ^kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration is here
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^There are already a couple of inclusions of "
../locking/rtmutex_common.h", so assume this is safe to do here.Fixes 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU task stall dump")Signed-off-by Arnd Bergmann <[email protected]>---
I wonder if it would be better to either move thert_mutex_owner()definition into a global header likeinclude/linux/rtmutex.h, or to move the code out oftree_stall.hinto a .c file, as this feels like a layering violation.--- kernel/rcu/tree_stall.h | 1 + 1 file changed, 1 insertion(+)kernel/rcu/tree_stall.h +1
-1@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" ////////////////////////////////////////////////////////////////////////////// // --2.53.0
Paul E. McKenney
maintainerQuoted 17 lines · KunWu Chan
Quoted 16 lines · Paul E. McKenney
Quoted 13 lines · KunWu Chan
Thanks, Arnd.
Tested on top of
1eccf02fb8d5withCONFIG_PREEMPT_RCU=y:
CONFIG_RT_MUTEXES=y: build passesCONFIG_RT_MUTEXES=n: fails without this patch, passes with itThe failure is in
tree_stall.h, wherert_mutex_owner()is used beforetree_plugin.hincludesrtmutex_common.h. This matches the reported failure, and the added include fixes it.Reviewed-by Kunwu Chan <[email protected]>Tested-by Kunwu Chan <[email protected]>
Quoted 6 lines
Quoted 4 lines
Bradley and Kunwu, are you OK with my applying your tags to the commit that I am merging this into?
1eccf02fb8d5("rcu: Add running and boosted indications to RCU task stall dump")Sure. Thanks, Paul.
Thank you, and I will apply them on my next rebase.
Thanx, Paul
Quoted 58 lines
Kunwu
Quoted 56 lines
Quoted 56 lines
Thanks,
KunwuQuoted 51 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The added call to
rt_mutex_owner()makes this fail to build in some configurations:In file included from
kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function 'rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^kernel/rcu/tree_stall.h:333:48: error: comparison between pointer and integer ('int' and 'structtask_struct*') [-Werror,-Wpointer-integer-compare]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~In file included from
kernel/rcu/tree.c:5124:
In file included fromkernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflicting types for 'rt_mutex_owner'
231 | static inline structtask_struct*rt_mutex_owner(structrt_mutex_base*lock)
| ^kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration is here
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^There are already a couple of inclusions of "
../locking/rtmutex_common.h", so assume this is safe to do here.Fixes 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU task stall dump")Signed-off-by Arnd Bergmann <[email protected]>---
I wonder if it would be better to either move thert_mutex_owner()definition into a global header likeinclude/linux/rtmutex.h, or to move the code out oftree_stall.hinto a .c file, as this feels like a layering violation.--- kernel/rcu/tree_stall.h | 1 + 1 file changed, 1 insertion(+)kernel/rcu/tree_stall.h +1
-1@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" ////////////////////////////////////////////////////////////////////////////// // --2.53.0
Paul E. McKenney
maintainerQuoted 24 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The added call to
rt_mutex_owner()makes this fail to build in some configurations:In file included from
kernel/rcu/tree.c:5121:kernel/rcu/tree_stall.h:333:8: error: call to undeclared function 'rt_mutex_owner'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^kernel/rcu/tree_stall.h:333:48: error: comparison between pointer and integer ('int' and 'structtask_struct*') [-Werror,-Wpointer-integer-compare]
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~In file included from
kernel/rcu/tree.c:5124:
In file included fromkernel/rcu/tree_plugin.h:14:kernel/rcu/../locking/rtmutex_common.h:231:35: error: conflicting types for 'rt_mutex_owner'
231 | static inline structtask_struct*rt_mutex_owner(structrt_mutex_base*lock)
| ^kernel/rcu/tree_stall.h:333:8: note: previous implicit declaration is here
333 | if (rt_mutex_owner(&rnp->boost_mtx.rtmutex)== t)
| ^There are already a couple of inclusions of "
../locking/rtmutex_common.h", so assume this is safe to do here.
Quoted 7 lines
Fixes 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU task stall dump")Signed-off-by Arnd Bergmann <[email protected]>---
I wonder if it would be better to either move thert_mutex_owner()definition into a global header likeinclude/linux/rtmutex.h, or to move the code out oftree_stall.hinto a .c file, as this feels like a layering violation.
Good catch, and thank you!!!
What I am going to do in the name of bisectability is to merge this into the commit that added that call to rt_mutex_owner(), which attribution:
1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU task stall dump")
I am also removing the #include of that same file from it old place in kernel/rcu/tree_plugin.h, where it has lived since 2014.
But you are right that this is the only #include of that file outside of kernel/locking.
Fair enough?
Thanx, Paul
Quoted 19 lines
--- kernel/rcu/tree_stall.h | 1 + 1 file changed, 1 insertion(+)kernel/rcu/tree_stall.h +1
-0@@ -12,6 +12,7 @@#include <linux/rcu_notifier.h> #include <linux/smp.h> #include <linux/rtmutex.h> +#include "../locking/rtmutex_common.h" ////////////////////////////////////////////////////////////////////////////// // Signature · 1 line
2.53.0
Quoted 8 lines · Paul E. McKenney
On Fri, Sep 25, 2026 at 03:39:04PM +0200, Arnd Bergmann wrote:
Good catch, and thank you!!!
What I am going to do in the name of bisectability is to merge this into the commit that added that call to
rt_mutex_owner(), which attribution:
1eccf02fb8d5("rcu: Add running and boosted indications to RCU task stall dump")
Sounds good to me. Don't worry too much about attribution, you can always treat my oneline fixes as bug reports. I just try to make it easy to apply as-is in case you are not rebasing your patches.
Arnd
Paul E. McKenney
maintainerQuoted 5 lines · Arnd Bergmann
Quoted 4 lines · Paul E. McKenney
On Fri, Sep 25, 2026 at 03:39:04PM +0200, Arnd Bergmann wrote:
Good catch, and thank you!!!
Quoted 8 lines
Quoted 4 lines
What I am going to do in the name of bisectability is to merge this into the commit that added that call to
rt_mutex_owner(), which attribution:
1eccf02fb8d5("rcu: Add running and boosted indications to RCU task stall dump")Sounds good to me. Don't worry too much about attribution, you can always treat my oneline fixes as bug reports. I just try to make it easy to apply as-is in case you are not rebasing your patches.
Like this:
[ paulmck: Apply feedback from Arnd Bergmann and kernel test robot. ]
;-)
Thanx, Paul