public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] remove irqs_disabled warning from local_bh_enable
@ 2008-06-17 21:57 Johannes Berg
  2008-06-17 23:08 ` David Miller
  2008-06-17 23:55 ` Linus Torvalds
  0 siblings, 2 replies; 18+ messages in thread
From: Johannes Berg @ 2008-06-17 21:57 UTC (permalink / raw)
  To: Linux Kernel list
  Cc: Michael Buesch, David Ellingsworth, linux-wireless, Ingo Molnar,
	Linus Torvalds

This warning has started to trigger with mac80211 because it can, under
some circumstances, use spin_lock_bh() protected sections within
irq-disabled sections. Is that a bug?

Interestingly, the warning was never noticed until somebody ran the code
on UP/NO-PREEMPT because local_bh_enable_ip() does not contain such a
warning. Also, because softirq disabling is refcounted (via the preempt
counter), it ought to be safe to nest it and even use within
irqs-disabled sections, as far as I can tell.

Also, if you're going to treat IRQs being enabled as a bug, there's no
point in disabling them right afterwards, is there?

If you're going to reject this patch, I'll post one that adds the
warning to local_bh_enable_ip() to allow detecting this for everybody
and not just those poor people running UP/NO-PREEMPT :)

(and why doesn't local_bh_enable just call local_bh_enable_ip anyway? or
both "call" a common static inline?)
---
 kernel/softirq.c |    3 ---
 1 file changed, 3 deletions(-)

--- everything.orig/kernel/softirq.c	2008-06-17 23:48:25.000000000 +0200
+++ everything/kernel/softirq.c	2008-06-17 23:48:56.000000000 +0200
@@ -137,10 +137,7 @@ void local_bh_enable(void)
 	unsigned long flags;
 
 	WARN_ON_ONCE(in_irq());
-#endif
-	WARN_ON_ONCE(irqs_disabled());
 
-#ifdef CONFIG_TRACE_IRQFLAGS
 	local_irq_save(flags);
 #endif
 	/*



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

end of thread, other threads:[~2008-06-27 10:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-17 21:57 [PATCH/RFC] remove irqs_disabled warning from local_bh_enable Johannes Berg
2008-06-17 23:08 ` David Miller
2008-06-17 23:55 ` Linus Torvalds
2008-06-18  7:01   ` Peter Zijlstra
2008-06-18  7:29   ` Johannes Berg
2008-06-20 13:46     ` Ingo Molnar
2008-06-20 15:27       ` Ingo Molnar
2008-06-20 15:36         ` Michael Buesch
2008-06-20 15:55           ` Ingo Molnar
2008-06-20 16:01             ` Michael Buesch
2008-06-20 16:18               ` Michael Buesch
2008-06-23  8:41                 ` Ingo Molnar
2008-06-23  9:22                   ` Michael Buesch
2008-06-27  5:33                   ` Jeff Garzik
2008-06-27 10:53                     ` Ingo Molnar
2008-06-27 10:56                       ` Johannes Berg
2008-06-20 15:43         ` Johannes Berg
2008-06-20 15:46           ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox