All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] locking/rtmutex: Add the missing 'ES' of macro CONFIG_DEBUG_RT_MUTEXES
@ 2021-07-31 12:30 Zhen Lei
  2021-08-09 14:41 ` Will Deacon
  2021-08-10  6:24 ` [tip: locking/urgent] locking/rtmutex: Use the correct rtmutex debugging config option tip-bot2 for Zhen Lei
  0 siblings, 2 replies; 5+ messages in thread
From: Zhen Lei @ 2021-07-31 12:30 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long,
	Boqun Feng, Thomas Gleixner, linux-kernel
  Cc: Zhen Lei

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;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] locking/rtmutex: Add the missing 'ES' of macro CONFIG_DEBUG_RT_MUTEXES
  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  6:24 ` [tip: locking/urgent] locking/rtmutex: Use the correct rtmutex debugging config option tip-bot2 for Zhen Lei
  1 sibling, 1 reply; 5+ messages in thread
From: Will Deacon @ 2021-08-09 14:41 UTC (permalink / raw)
  To: Zhen Lei
  Cc: Peter Zijlstra, Ingo Molnar, Waiman Long, Boqun Feng,
	Thomas Gleixner, linux-kernel

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?

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

Will

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] locking/rtmutex: Add the missing 'ES' of macro CONFIG_DEBUG_RT_MUTEXES
  2021-08-09 14:41 ` Will Deacon
@ 2021-08-10  1:21   ` Leizhen (ThunderTown)
  2021-08-10  1:47     ` Boqun Feng
  0 siblings, 1 reply; 5+ messages in thread
From: Leizhen (ThunderTown) @ 2021-08-10  1:21 UTC (permalink / raw)
  To: Will Deacon
  Cc: Peter Zijlstra, Ingo Molnar, Waiman Long, Boqun Feng,
	Thomas Gleixner, linux-kernel



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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] locking/rtmutex: Add the missing 'ES' of macro CONFIG_DEBUG_RT_MUTEXES
  2021-08-10  1:21   ` Leizhen (ThunderTown)
@ 2021-08-10  1:47     ` Boqun Feng
  0 siblings, 0 replies; 5+ messages in thread
From: Boqun Feng @ 2021-08-10  1:47 UTC (permalink / raw)
  To: Leizhen (ThunderTown)
  Cc: Will Deacon, Peter Zijlstra, Ingo Molnar, Waiman Long,
	Thomas Gleixner, linux-kernel

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
> > .
> > 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip: locking/urgent] locking/rtmutex: Use the correct rtmutex debugging config option
  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  6:24 ` tip-bot2 for Zhen Lei
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot2 for Zhen Lei @ 2021-08-10  6:24 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Zhen Lei, Thomas Gleixner, Will Deacon, Boqun Feng, stable, x86,
	linux-kernel

The following commit has been merged into the locking/urgent branch of tip:

Commit-ID:     07d25971b220e477eb019fcb520a9f2e3ac966af
Gitweb:        https://git.kernel.org/tip/07d25971b220e477eb019fcb520a9f2e3ac966af
Author:        Zhen Lei <thunder.leizhen@huawei.com>
AuthorDate:    Sat, 31 Jul 2021 20:30:11 +08:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Tue, 10 Aug 2021 08:21:52 +02:00

locking/rtmutex: Use the correct rtmutex debugging config option

It's CONFIG_DEBUG_RT_MUTEXES not CONFIG_DEBUG_RT_MUTEX.

Fixes: f7efc4799f81 ("locking/rtmutex: Inline chainwalk depth check")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Boqun Feng <boqun.feng@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210731123011.4555-1-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 b5d9bb5..ad0db32 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;
 }

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-10  6:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-08-10  6:24 ` [tip: locking/urgent] locking/rtmutex: Use the correct rtmutex debugging config option tip-bot2 for Zhen Lei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.