mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] locking/mutex: remove redundant ifdef
@ 2025-07-04  1:52 ranxiaokai627
  2025-07-04 13:57 ` Waiman Long
  2025-07-19 17:40 ` [tip: locking/core] locking/mutex: Remove redundant #ifdefs tip-bot2 for Ran Xiaokai
  0 siblings, 2 replies; 4+ messages in thread
From: ranxiaokai627 @ 2025-07-04  1:52 UTC (permalink / raw)
  To: peterz, mingo, will, boqun.feng, longman; +Cc: linux-kernel, ran.xiaokai

From: Ran Xiaokai <ran.xiaokai@zte.com.cn>

hung_task_set/clear_blocker() is already guarded by
CONFIG_DETECT_HUNG_TASK_BLOCKER in hung_task.h, So remove
the redudant check of #ifdef.

Signed-off-by: Ran Xiaokai <ran.xiaokai@zte.com.cn>
---
 kernel/locking/mutex.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index a39ecccbd106..d4210dc97b6a 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -191,9 +191,7 @@ static void
 __mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
 		   struct list_head *list)
 {
-#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
 	hung_task_set_blocker(lock, BLOCKER_TYPE_MUTEX);
-#endif
 	debug_mutex_add_waiter(lock, waiter, current);
 
 	list_add_tail(&waiter->list, list);
@@ -209,9 +207,7 @@ __mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter)
 		__mutex_clear_flag(lock, MUTEX_FLAGS);
 
 	debug_mutex_remove_waiter(lock, waiter, current);
-#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
 	hung_task_clear_blocker();
-#endif
 }
 
 /*
-- 
2.25.1


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

* Re: [PATCH] locking/mutex: remove redundant ifdef
  2025-07-04  1:52 [PATCH] locking/mutex: remove redundant ifdef ranxiaokai627
@ 2025-07-04 13:57 ` Waiman Long
  2025-07-11 22:17   ` Boqun Feng
  2025-07-19 17:40 ` [tip: locking/core] locking/mutex: Remove redundant #ifdefs tip-bot2 for Ran Xiaokai
  1 sibling, 1 reply; 4+ messages in thread
From: Waiman Long @ 2025-07-04 13:57 UTC (permalink / raw)
  To: ranxiaokai627, peterz, mingo, will, boqun.feng; +Cc: linux-kernel, ran.xiaokai


On 7/3/25 9:52 PM, ranxiaokai627@163.com wrote:
> From: Ran Xiaokai <ran.xiaokai@zte.com.cn>
>
> hung_task_set/clear_blocker() is already guarded by
> CONFIG_DETECT_HUNG_TASK_BLOCKER in hung_task.h, So remove
> the redudant check of #ifdef.
>
> Signed-off-by: Ran Xiaokai <ran.xiaokai@zte.com.cn>
> ---
>   kernel/locking/mutex.c | 4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
> index a39ecccbd106..d4210dc97b6a 100644
> --- a/kernel/locking/mutex.c
> +++ b/kernel/locking/mutex.c
> @@ -191,9 +191,7 @@ static void
>   __mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
>   		   struct list_head *list)
>   {
> -#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
>   	hung_task_set_blocker(lock, BLOCKER_TYPE_MUTEX);
> -#endif
>   	debug_mutex_add_waiter(lock, waiter, current);
>   
>   	list_add_tail(&waiter->list, list);
> @@ -209,9 +207,7 @@ __mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter)
>   		__mutex_clear_flag(lock, MUTEX_FLAGS);
>   
>   	debug_mutex_remove_waiter(lock, waiter, current);
> -#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
>   	hung_task_clear_blocker();
> -#endif
>   }
>   
>   /*
Acked-by: Waiman Long <longman@redhat.com>


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

* Re: [PATCH] locking/mutex: remove redundant ifdef
  2025-07-04 13:57 ` Waiman Long
@ 2025-07-11 22:17   ` Boqun Feng
  0 siblings, 0 replies; 4+ messages in thread
From: Boqun Feng @ 2025-07-11 22:17 UTC (permalink / raw)
  To: Waiman Long; +Cc: ranxiaokai627, peterz, mingo, will, linux-kernel, ran.xiaokai

On Fri, Jul 04, 2025 at 09:57:35AM -0400, Waiman Long wrote:
> 
> On 7/3/25 9:52 PM, ranxiaokai627@163.com wrote:
> > From: Ran Xiaokai <ran.xiaokai@zte.com.cn>
> > 
> > hung_task_set/clear_blocker() is already guarded by
> > CONFIG_DETECT_HUNG_TASK_BLOCKER in hung_task.h, So remove
> > the redudant check of #ifdef.
> > 
> > Signed-off-by: Ran Xiaokai <ran.xiaokai@zte.com.cn>

Queued for v6.17, thanks!

Regards,
Boqun

> > ---
> >   kernel/locking/mutex.c | 4 ----
> >   1 file changed, 4 deletions(-)
> > 
> > diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
> > index a39ecccbd106..d4210dc97b6a 100644
> > --- a/kernel/locking/mutex.c
> > +++ b/kernel/locking/mutex.c
> > @@ -191,9 +191,7 @@ static void
> >   __mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
> >   		   struct list_head *list)
> >   {
> > -#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
> >   	hung_task_set_blocker(lock, BLOCKER_TYPE_MUTEX);
> > -#endif
> >   	debug_mutex_add_waiter(lock, waiter, current);
> >   	list_add_tail(&waiter->list, list);
> > @@ -209,9 +207,7 @@ __mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter)
> >   		__mutex_clear_flag(lock, MUTEX_FLAGS);
> >   	debug_mutex_remove_waiter(lock, waiter, current);
> > -#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
> >   	hung_task_clear_blocker();
> > -#endif
> >   }
> >   /*
> Acked-by: Waiman Long <longman@redhat.com>
> 

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

* [tip: locking/core] locking/mutex: Remove redundant #ifdefs
  2025-07-04  1:52 [PATCH] locking/mutex: remove redundant ifdef ranxiaokai627
  2025-07-04 13:57 ` Waiman Long
@ 2025-07-19 17:40 ` tip-bot2 for Ran Xiaokai
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Ran Xiaokai @ 2025-07-19 17:40 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Ran Xiaokai, Waiman Long, Boqun Feng, x86, linux-kernel

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

Commit-ID:     1dfe5ea6dbb3e03073f5426d65394694683b8692
Gitweb:        https://git.kernel.org/tip/1dfe5ea6dbb3e03073f5426d65394694683b8692
Author:        Ran Xiaokai <ran.xiaokai@zte.com.cn>
AuthorDate:    Fri, 04 Jul 2025 01:52:18 
Committer:     Boqun Feng <boqun.feng@gmail.com>
CommitterDate: Mon, 14 Jul 2025 21:57:29 -07:00

locking/mutex: Remove redundant #ifdefs

hung_task_{set,clear}_blocker() is already guarded by
CONFIG_DETECT_HUNG_TASK_BLOCKER in hung_task.h, So remove
the redudant check of #ifdef.

Signed-off-by: Ran Xiaokai <ran.xiaokai@zte.com.cn>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://lore.kernel.org/r/20250704015218.359754-1-ranxiaokai627@163.com
---
 kernel/locking/mutex.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index a39eccc..d4210dc 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -191,9 +191,7 @@ static void
 __mutex_add_waiter(struct mutex *lock, struct mutex_waiter *waiter,
 		   struct list_head *list)
 {
-#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
 	hung_task_set_blocker(lock, BLOCKER_TYPE_MUTEX);
-#endif
 	debug_mutex_add_waiter(lock, waiter, current);
 
 	list_add_tail(&waiter->list, list);
@@ -209,9 +207,7 @@ __mutex_remove_waiter(struct mutex *lock, struct mutex_waiter *waiter)
 		__mutex_clear_flag(lock, MUTEX_FLAGS);
 
 	debug_mutex_remove_waiter(lock, waiter, current);
-#ifdef CONFIG_DETECT_HUNG_TASK_BLOCKER
 	hung_task_clear_blocker();
-#endif
 }
 
 /*

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

end of thread, other threads:[~2025-07-19 17:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-04  1:52 [PATCH] locking/mutex: remove redundant ifdef ranxiaokai627
2025-07-04 13:57 ` Waiman Long
2025-07-11 22:17   ` Boqun Feng
2025-07-19 17:40 ` [tip: locking/core] locking/mutex: Remove redundant #ifdefs tip-bot2 for Ran Xiaokai

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®