mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: David Miller <davem@davemloft.net>
Cc: jarkao2@gmail.com, jeff@garzik.org, johannes@sipsolutions.net,
	wferi@niif.hu, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netconsole: Disable softirqs in write_msg()
Date: Wed, 19 Nov 2008 11:14:41 +0100	[thread overview]
Message-ID: <20081119101441.GB6184@elte.hu> (raw)
In-Reply-To: <20081119.014222.193698982.davem@davemloft.net>


* David Miller <davem@davemloft.net> wrote:

> From: Ingo Molnar <mingo@elte.hu>
> Date: Wed, 19 Nov 2008 10:30:04 +0100
> 
> > * Jarek Poplawski <jarkao2@gmail.com> wrote:
> > 
> > > diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
> > > index d304d38..f6ecad8 100644
> > > --- a/drivers/net/netconsole.c
> > > +++ b/drivers/net/netconsole.c
> > > @@ -702,6 +702,8 @@ static void write_msg(struct console *con, const char *msg, unsigned int len)
> > >  	if (list_empty(&target_list))
> > >  		return;
> > >  
> > > +	/* Avoid enabling softirqs with hardirqs disabled */
> > > +	local_bh_disable();
> > >  	spin_lock_irqsave(&target_list_lock, flags);
> > >  	list_for_each_entry(nt, &target_list, list) {
> > >  		netconsole_target_get(nt);
> > > @@ -723,6 +725,7 @@ static void write_msg(struct console *con, const char *msg, unsigned int len)
> > >  		netconsole_target_put(nt);
> > >  	}
> > >  	spin_unlock_irqrestore(&target_list_lock, flags);
> > > +	local_bh_enable();
> > 
> > but netconsole can be triggered from printk - and printk can be called 
> > from hardirqs-off sections - so this doesnt really fix the bug. 
> > Netconsole should not do BH processing.
> 
> Well, it sort of "has to".  It calls the NAPI ->poll() method of the 
> driver to try and make forward progress with TX reclaim so it can 
> send new messages.
> 
> It is very careful not to recursively invoke into ->poll() and other 
> nasty situations.
> 
> Didn't you write some of this code Ingo a very long time ago? :-)))

it is causing problems, so i'd like to distance myself from that 
careless mistake of my youth! [ And once it starts working again i'd 
like to take credit for having started that brilliant piece of 
innovation. ]

> Anyways, I'll look more closely at this and the original report, 
> this never was a problem before.

Thanks! We strengthened/cleaned up the bh checks a tiny bit recently, 
maybe that caused this to pop up. It might explain some netconsole 
lockups perhaps? Or, the new warning might be bogus. It's a bit of a 
maze.

	Ingo

  reply	other threads:[~2008-11-19 10:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87y6zwwy5c.fsf@tac.ki.iif.hu>
2008-11-17 13:35 ` [PATCH] softirq: Use local_irq_save() in local_bh_enable() Jarek Poplawski
2008-11-17 14:18   ` Johannes Berg
2008-11-18  7:49     ` Jarek Poplawski
2008-11-17 16:16   ` Ingo Molnar
2008-11-18  7:38     ` Jarek Poplawski
2008-11-19  8:41 ` [PATCH] netconsole: Disable softirqs in write_msg() Jarek Poplawski
2008-11-19  9:30   ` Ingo Molnar
2008-11-19  9:42     ` David Miller
2008-11-19 10:14       ` Ingo Molnar [this message]
2008-11-19 10:17         ` David Miller
2008-11-19 10:21           ` Ingo Molnar
2008-11-19 10:22             ` David Miller
2008-11-19 10:10   ` David Miller
2008-11-19  8:41 ` [PATCH] softirq: Fix warnings triggered by netconsole Jarek Poplawski
2008-11-19  9:32   ` Ingo Molnar
2008-11-19 11:07     ` Jarek Poplawski

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=20081119101441.GB6184@elte.hu \
    --to=mingo@elte.hu \
    --cc=davem@davemloft.net \
    --cc=jarkao2@gmail.com \
    --cc=jeff@garzik.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wferi@niif.hu \
    /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

all inboxes | Powered by JetHome®