linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Chuck Ebbert <cebbert@redhat.com>
Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Anant Nitya <kernel@prachanda.info>,
	linux-kernel@vger.kernel.org, David Miller <davem@davemloft.net>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [BUG] local_softirq_pending storm
Date: Thu, 24 May 2007 09:45:34 +0200	[thread overview]
Message-ID: <20070524074534.GA21138@elte.hu> (raw)
In-Reply-To: <46547345.8000808@redhat.com>


* Chuck Ebbert <cebbert@redhat.com> wrote:

> >  	if (need_resched() && system_state == SYSTEM_RUNNING) {
> > -		raw_local_irq_disable();
> > -		_local_bh_enable();
> > -		raw_local_irq_enable();
> > +		local_bh_enable();
> >  		__cond_resched();
> >  		local_bh_disable();
> >  		return 1;
> 
> We may have a problem with that:
> 
>  BUG: warning at kernel/softirq.c:138/local_bh_enable() (Not tainted)
>   [<c042b2ef>] local_bh_enable+0x45/0x92
>   [<c06036b7>] cond_resched_softirq+0x2c/0x42
>   [<c059d5d0>] release_sock+0x54/0xa3
>   [<c05c9428>] tcp_sendmsg+0x91b/0xa0c
>   [<c05e1bb9>] inet_sendmsg+0x3b/0x45
>   [<c059af34>] sock_aio_write+0xf9/0x105
>   [<c0476035>] do_sync_write+0xc7/0x10a
>   [<c0437265>] autoremove_wake_function+0x0/0x35
>   [<c047688e>] vfs_write+0xbc/0x154
>   [<c0476e8c>] sys_write+0x41/0x67
>   [<c0404f70>] syscall_call+0x7/0xb

hm, this place really shouldnt call cond_resched_softirq() with hardirqs 
disabled.

perhaps a buggy ->sk_backlog_rcv() handler disabled interrupts without 
restoring them?

could you enable CONFIG_PROVE_LOCKING and apply the patch below - which 
location is printed as having last disabled hardirqs?

	Ingo

--------------------->
Subject: [patch] softirqs: print out irq-trace events
From: Ingo Molnar <mingo@elte.hu>

some code is fiddling with softirqs but hardirqs are disabled, so try to 
figure out who disabled hardirqs.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/softirq.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Index: linux/kernel/softirq.c
===================================================================
--- linux.orig/kernel/softirq.c
+++ linux/kernel/softirq.c
@@ -135,7 +135,15 @@ void local_bh_enable(void)
 
 	WARN_ON_ONCE(in_irq());
 #endif
-	WARN_ON_ONCE(irqs_disabled());
+	if (irqs_disabled()) {
+		static int once = 1;
+
+		if (once) {
+			once = 0;
+			print_irqtrace_events(current);
+			WARN_ON(1);
+		}
+	}
 
 #ifdef CONFIG_TRACE_IRQFLAGS
 	local_irq_save(flags);

  parent reply	other threads:[~2007-05-24  7:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-09 14:12 [BUG] local_softirq_pending storm Anant Nitya
2007-05-09 16:31 ` Thomas Gleixner
2007-05-10 11:53   ` Anant Nitya
2007-05-10 21:58     ` Thomas Gleixner
2007-05-17  6:41       ` Anant Nitya
2007-05-18 13:01         ` Thomas Gleixner
2007-05-19  4:30           ` Anant Nitya
2007-05-19  9:55           ` Anant Nitya
2007-05-19 19:11             ` Thomas Gleixner
2007-05-19 21:23               ` Anant Nitya
2007-05-20 21:43                 ` Thomas Gleixner
2007-05-21  6:22                   ` Anant Nitya
2007-05-21  9:01                     ` Thomas Gleixner
2007-05-21 10:02                       ` Anant Nitya
2007-05-21 18:45                       ` Anant Nitya
2007-05-22 19:03                   ` Michal Piotrowski
2007-05-22 19:59                     ` Michal Piotrowski
2007-05-22 20:10                     ` Ingo Molnar
2007-05-22 20:23                       ` Michal Piotrowski
2007-05-23 17:00                       ` Chuck Ebbert
2007-05-23 18:38                         ` Chuck Ebbert
2007-05-23 23:24                           ` Anant Nitya
2007-05-24  7:45                         ` Ingo Molnar [this message]
2007-05-20 10:18               ` Heiko Carstens
2007-05-20 13:52                 ` Thomas Gleixner
2007-05-20 18:36                   ` Heiko Carstens
     [not found]                     ` <20070520191800.GA14225@osiris.ibm.com>
     [not found]                       ` <1179689389.6570.1.camel@chaos>
     [not found]                         ` <20070521200428.GA9855@osiris.ibm.com>
2007-05-23 20:54                           ` Mikulas Patocka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070524074534.GA21138@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=cebbert@redhat.com \
    --cc=davem@davemloft.net \
    --cc=kernel@prachanda.info \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).