From: Bradley Morgan <brads@mainlining.org>
To: paulmck@kernel.org
Cc: arighi@nvidia.com, arnd@arndb.de, arnd@kernel.org,
boqun@kernel.org, frederic@kernel.org, gustavold@gmail.com,
jiangshanlai@gmail.com, joelagnelf@nvidia.com,
josh@joshtriplett.org, kunwu.chan@gmail.com,
linux-kernel@vger.kernel.org, mathieu.desnoyers@efficios.com,
neeraj.upadhyay@kernel.org, qiang.zhang@linux.dev,
rcu@vger.kernel.org, rostedt@goodmis.org, tglx@kernel.org,
tj@kernel.org, urezki@gmail.com, yphbchou0911@gmail.com
Subject: Re: [PATCH] rcu: include rtmutex_common.h in tree_stall.h
Date: Wed, 30 Sep 2026 19:36:20 +0100 [thread overview]
Message-ID: <28A04B09-71B0-4BBA-825C-7F80E57BCF3A@mainlining.org> (raw)
In-Reply-To: <0fbaa5c5-3f75-4fd2-8537-0576eb11abbe@paulmck-laptop>
On 29 September 2026 22:08:49 BST, "Paul E. McKenney" <paulmck@kernel.org>
wrote:
>On Mon, Sep 28, 2026 at 10:54:13AM +0800, KunWu Chan wrote:
>> 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.
>>
>> Reviewed-by: Kunwu Chan <kunwu.chan@gmail.com>
>> Tested-by: Kunwu Chan <kunwu.chan@gmail.com>
>
>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
> Thanx, Paul
>
>> Thanks,
>> Kunwu
>>
>> On Fri, Sep 25, 2026 at 9:39 PM Arnd Bergmann <arnd@kernel.org> wrote:
>> >
>> > From: Arnd Bergmann <arnd@arndb.de>
>> >
>> > 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.
>> >
>> > Fixes: 1eccf02fb8d5 ("rcu: Add running and boosted indications to RCU
>task stall dump")
>> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> > ---
>> > 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(+)
>> >
>> > diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
>> > index 5dded1e89197..803a56af3259 100644
>> > --- a/kernel/rcu/tree_stall.h
>> > +++ b/kernel/rcu/tree_stall.h
>> > @@ -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
>> >
>>
>
>
--- Thanks!
"I'm not a very positive person" - Linus torvalds
next prev parent reply other threads:[~2026-09-30 18:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 13:39 Arnd Bergmann
2026-09-27 20:03 ` Bradley Morgan
2026-09-28 2:54 ` KunWu Chan
2026-09-29 21:08 ` Paul E. McKenney
2026-09-30 18:36 ` Bradley Morgan [this message]
2026-09-30 20:07 ` Paul E. McKenney
2026-10-02 6:36 ` KunWu Chan
2026-10-02 15:48 ` Paul E. McKenney
2026-09-29 21:07 ` Paul E. McKenney
2026-09-30 7:07 ` Arnd Bergmann
2026-09-30 17:58 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=28A04B09-71B0-4BBA-825C-7F80E57BCF3A@mainlining.org \
--to=brads@mainlining.org \
--cc=arighi@nvidia.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=boqun@kernel.org \
--cc=frederic@kernel.org \
--cc=gustavold@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=kunwu.chan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@kernel.org \
--cc=tj@kernel.org \
--cc=urezki@gmail.com \
--cc=yphbchou0911@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®