From: Bart Van Assche <bvanassche@acm.org>
To: Sabrina Dubroca <sd@queasysnail.net>,
Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
jeffrey.t.kirsher@intel.com
Subject: Re: e1000_netpoll(): disable_irq() triggers might_sleep() on linux-next
Date: Mon, 22 Dec 2014 16:28:08 +0100 [thread overview]
Message-ID: <54983888.4030109@acm.org> (raw)
In-Reply-To: <20141202163530.GA19420@kria>
On 12/02/14 17:35, Sabrina Dubroca wrote:
> Hello, sorry for the delay.
>
> 2014-10-29, 20:36:03 +0100, Peter Zijlstra wrote:
>> On Wed, Oct 29, 2014 at 07:33:00PM +0100, Thomas Gleixner wrote:
>>> Yuck. No. You are just papering over the problem.
>>>
>>> What happens if you add 'threadirqs' to the kernel command line? Or if
>>> the interrupt line is shared with a real threaded interrupt user?
>>>
>>> The proper solution is to have a poll_lock for e1000 which serializes
>>> the hardware interrupt against netpoll instead of using
>>> disable/enable_irq().
>>>
>>> In fact that's less expensive than the disable/enable_irq() dance and
>>> the chance of contention is pretty low. If done right it will be a
>>> NOOP for the CONFIG_NET_POLL_CONTROLLER=n case.
>>>
>>
>> OK a little something like so then I suppose.. But I suspect most all
>> the network drivers will need this and maybe more, disable_irq() is a
>> popular little thing and we 'just' changed semantics on them.
>>
>> ---
>> drivers/net/ethernet/intel/e1000/e1000.h | 2 ++
>> drivers/net/ethernet/intel/e1000/e1000_main.c | 22 +++++++++++++++++-----
>> kernel/irq/manage.c | 2 +-
>> 3 files changed, 20 insertions(+), 6 deletions(-)
>
> I've been running with variants of this patch, things seem ok.
>
> As noted earlier, there are a lot of drivers doing this disable_irq +
> irq_handler + enable_irq sequence. I found about 60.
> Many already take a lock in the interrupt handler, and look like we
> could just remove the call to disable_irq (example: cp_interrupt,
> drivers/net/ethernet/realtek/8139cp.c).
>
> Here's how I modified your patch. The locking compiles away if
> CONFIG_NET_POLL_CONTROLLER=n.
>
> I can work on converting all the drivers from disable_irq to
> netpoll_irq_lock, if that's okay with you.
>
> In igb there's also a synchronize_irq() called from the netpoll
> controller (in igb_irq_disable()), I think a similar locking scheme
> would work.
> I also saw a few disable_irq_nosync and disable_percpu_irq. These are
> okay?
>
> [ ... ]
Hello,
Earlier today I ran into the bug mentioned at the start of this thread
with kernel 3.19-rc1 and the e1000e driver. Can anyone tell me what the
latest status is ?
Thanks,
Bart.
next prev parent reply other threads:[~2014-12-22 15:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 15:56 e1000_netpoll(): disable_irq() triggers might_sleep() on linux-next Sabrina Dubroca
2014-10-29 18:07 ` Peter Zijlstra
2014-10-29 18:33 ` Thomas Gleixner
2014-10-29 19:36 ` Peter Zijlstra
2014-10-29 19:40 ` Jeff Kirsher
2014-10-29 19:53 ` Thomas Gleixner
2014-10-29 19:49 ` Thomas Gleixner
2014-10-29 19:50 ` Peter Zijlstra
2014-10-29 20:07 ` Thomas Gleixner
2014-10-29 20:23 ` Thomas Gleixner
2014-10-29 20:51 ` Peter Zijlstra
2014-10-29 21:03 ` Thomas Gleixner
2014-12-02 16:35 ` Sabrina Dubroca
2014-12-22 15:28 ` Bart Van Assche [this message]
2015-01-05 10:06 ` Bart Van Assche
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=54983888.4030109@acm.org \
--to=bvanassche@acm.org \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=sd@queasysnail.net \
--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).