All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] softirq: Remove the unnecessary CONFIG_TRACE_IRQFLAGS
@ 2021-06-02  7:34 Yejune Deng
  2021-06-02 17:53 ` Kees Cook
  0 siblings, 1 reply; 3+ messages in thread
From: Yejune Deng @ 2021-06-02  7:34 UTC (permalink / raw)
  To: tglx, peterz, frederic, mingo, keescook, dave; +Cc: linux-kernel, Yejune Deng

The local_irq_enable() and local_irq_disable() had two definitions that
include CONFIG_TRACE_IRQFLAGS or not.

Signed-off-by: Yejune Deng <yejunedeng@gmail.com>
---
 kernel/softirq.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 4992853..a81d804 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -362,9 +362,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
 {
 	WARN_ON_ONCE(in_irq());
 	lockdep_assert_irqs_enabled();
-#ifdef CONFIG_TRACE_IRQFLAGS
 	local_irq_disable();
-#endif
 	/*
 	 * Are softirqs going to be turned on now:
 	 */
@@ -385,9 +383,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
 	}
 
 	preempt_count_dec();
-#ifdef CONFIG_TRACE_IRQFLAGS
 	local_irq_enable();
-#endif
 	preempt_check_resched();
 }
 EXPORT_SYMBOL(__local_bh_enable_ip);
-- 
2.7.4


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

* Re: [PATCH] softirq: Remove the unnecessary CONFIG_TRACE_IRQFLAGS
  2021-06-02  7:34 [PATCH] softirq: Remove the unnecessary CONFIG_TRACE_IRQFLAGS Yejune Deng
@ 2021-06-02 17:53 ` Kees Cook
  2021-08-10 13:59   ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2021-06-02 17:53 UTC (permalink / raw)
  To: Yejune Deng
  Cc: tglx, peterz, frederic, mingo, dave, linux-kernel, Yejune Deng

On Wed, Jun 02, 2021 at 03:34:42PM +0800, Yejune Deng wrote:
> The local_irq_enable() and local_irq_disable() had two definitions that
> include CONFIG_TRACE_IRQFLAGS or not.

Hm, this has a behavioral change. Current code only does tracing and
raw_local_irq_disable/enable when CONFIG_TRACE_IRQFLAGS. This change
causes it to always do raw_local_irq_disable/enable. Which is the right
behavior?

-Kees

> 
> Signed-off-by: Yejune Deng <yejunedeng@gmail.com>
> ---
>  kernel/softirq.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index 4992853..a81d804 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -362,9 +362,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
>  {
>  	WARN_ON_ONCE(in_irq());
>  	lockdep_assert_irqs_enabled();
> -#ifdef CONFIG_TRACE_IRQFLAGS
>  	local_irq_disable();
> -#endif
>  	/*
>  	 * Are softirqs going to be turned on now:
>  	 */
> @@ -385,9 +383,7 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt)
>  	}
>  
>  	preempt_count_dec();
> -#ifdef CONFIG_TRACE_IRQFLAGS
>  	local_irq_enable();
> -#endif
>  	preempt_check_resched();
>  }
>  EXPORT_SYMBOL(__local_bh_enable_ip);
> -- 
> 2.7.4
> 

-- 
Kees Cook

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

* Re: [PATCH] softirq: Remove the unnecessary CONFIG_TRACE_IRQFLAGS
  2021-06-02 17:53 ` Kees Cook
@ 2021-08-10 13:59   ` Thomas Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2021-08-10 13:59 UTC (permalink / raw)
  To: Kees Cook, Yejune Deng
  Cc: peterz, frederic, mingo, dave, linux-kernel, Yejune Deng

On Wed, Jun 02 2021 at 10:53, Kees Cook wrote:
> On Wed, Jun 02, 2021 at 03:34:42PM +0800, Yejune Deng wrote:
>> The local_irq_enable() and local_irq_disable() had two definitions that
>> include CONFIG_TRACE_IRQFLAGS or not.
>
> Hm, this has a behavioral change. Current code only does tracing and
> raw_local_irq_disable/enable when CONFIG_TRACE_IRQFLAGS. This change
> causes it to always do raw_local_irq_disable/enable. Which is the right
> behavior?

Disabling interrupts is only required when CONFIG_TRACE_IRQFLAGS=y. So
the code is correct as is.

Thanks,

        tglx

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02  7:34 [PATCH] softirq: Remove the unnecessary CONFIG_TRACE_IRQFLAGS Yejune Deng
2021-06-02 17:53 ` Kees Cook
2021-08-10 13:59   ` Thomas Gleixner

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.