Skip to contentSkip to conversation

softirq: Remove the unnecessary CONFIG_TRACE_IRQFLAGS

PATCH In review Yejune Deng 3 participants 3 messages Jun 2, 2021 – Aug 10, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 softirq: Remove the unnecessary CONFIG_TRACE_IRQFLAGS

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

---
 kernel/softirq.c | 4 ----
 1 file changed, 4 deletions(-)
kernel/softirq.c +0 -4
index 4992853..a81d804 100644
@@ -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);
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Yejune Deng

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

Quoted 33 lines
---
 kernel/softirq.c | 4 ----
 1 file changed, 4 deletions(-)
kernel/softirq.c +0 -4
index 4992853..a81d804 100644
@@ -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);
Signature · 1 line
2.7.4
Signature · 1 line
Kees Cook
#2 lore raw
Quoted 8 lines · Kees Cook
Quoted 2 lines · Yejune Deng

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