linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
Cc: Will Deacon <will@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Waiman Long <longman@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] locking/rtmutex: Add the missing 'ES' of macro CONFIG_DEBUG_RT_MUTEXES
Date: Tue, 10 Aug 2021 09:47:21 +0800	[thread overview]
Message-ID: <YRHaqT5jm8N4G0Nj@boqun-archlinux> (raw)
In-Reply-To: <196ac7c4-f6db-247c-689e-13e7bbae5660@huawei.com>

On Tue, Aug 10, 2021 at 09:21:15AM +0800, Leizhen (ThunderTown) wrote:
> 
> 
> On 2021/8/9 22:41, Will Deacon wrote:
> > On Sat, Jul 31, 2021 at 08:30:11PM +0800, Zhen Lei wrote:
> >> The build option name is defined as DEBUG_RT_MUTEXES in lib/Kconfig.debug,
> >> commit f41dcc18698e ("locking/rtmutex: Move debug functions as inlines
> >> into common header") can also corroborate this.
> >>
> >> Fixes: f7efc4799f81 ("locking/rtmutex: Inline chainwalk depth check")
> >> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> >> ---
> >>  kernel/locking/rtmutex.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
> >> index b5d9bb5202c6..ad0db322ed3b 100644
> >> --- a/kernel/locking/rtmutex.c
> >> +++ b/kernel/locking/rtmutex.c
> >> @@ -343,7 +343,7 @@ static __always_inline bool
> >>  rt_mutex_cond_detect_deadlock(struct rt_mutex_waiter *waiter,
> >>  			      enum rtmutex_chainwalk chwalk)
> >>  {
> >> -	if (IS_ENABLED(CONFIG_DEBUG_RT_MUTEX))
> >> +	if (IS_ENABLED(CONFIG_DEBUG_RT_MUTEXES))
> >>  		return waiter != NULL;
> >>  	return chwalk == RT_MUTEX_FULL_CHAINWALK;
> > 
> > Oops, yes. How did you find this?
> 
> I found it by chance. When locating a futex problem, I was confused when
> reading this part of the code. I used "git grep -wn CONFIG_DEBUG_RT_MUTEX"
> to search for the implementation in other places. But I found that it was
> not used in other places, then I checked the patch history and found it.
> 

FWIW, script/checkkconfigsymbols.py can be used to detect usage of
undefined CONFIG_*, Zhouyi Zhou used it to find a few cases in RCU
recently:

	https://lore.kernel.org/lkml/CAABZP2wuWtGAGRqWJb3Gewm5VLZdZ_C=LRZsFbaG3jcQabO3qA@mail.gmail.com/

And thanks for the fix:

Acked-by: Boqun Feng <boqun.feng@gmail.com>

Regards,
Boqun

> > 
> > Acked-by: Will Deacon <will@kernel.org>
> > 
> > Will
> > .
> > 

  reply	other threads:[~2021-08-10  1:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-31 12:30 [PATCH] locking/rtmutex: Add the missing 'ES' of macro CONFIG_DEBUG_RT_MUTEXES Zhen Lei
2021-08-09 14:41 ` Will Deacon
2021-08-10  1:21   ` Leizhen (ThunderTown)
2021-08-10  1:47     ` Boqun Feng [this message]
2021-08-10  6:24 ` [tip: locking/urgent] locking/rtmutex: Use the correct rtmutex debugging config option tip-bot2 for Zhen Lei

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=YRHaqT5jm8N4G0Nj@boqun-archlinux \
    --to=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=thunder.leizhen@huawei.com \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).