From: Matt Mackall <mpm@selenic.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: jmoyer@redhat.com, netdev@oss.sgi.com
Subject: Re: serious netpoll bug w/NAPI
Date: Wed, 16 Feb 2005 15:44:06 -0800 [thread overview]
Message-ID: <20050216234406.GA3120@waste.org> (raw)
In-Reply-To: <20050216150236.61ca5faf.davem@davemloft.net>
On Wed, Feb 16, 2005 at 03:02:36PM -0800, David S. Miller wrote:
> On Tue, 15 Feb 2005 21:07:22 -0800
> Matt Mackall <mpm@selenic.com> wrote:
>
> > Because dev->np->poll_lock now serializes all access to ->poll (when
> > netpoll is enabled on said device).
>
> I think there is still a problem.
>
> Sure, we won't recurse into ->poll(), but instead we'll loop forever
> in netpoll_send_skb() in this case when netif_queue_stopped() is true.
> We can't get into the ->poll() routine, so the TX queue can't make
> forward progress, yet we keep looping to the "repeat" label over
> and over again.
I'm not distinguishing between recursion and race with another CPU
yet. Hrmm.
> So we've replaced a crash via ->poll() re-entry with a deadlock
> in netpoll_send_skb() :-)
>
> I also think that taking a global spinlock for every ->poll()
> call is a huge price to pay on SMP.
Ok. We've got a few cases:
1) recursion on cpu1
2) netpoll on cpu1 starts after softirq ->poll on cpu2
3) netpoll on cpu1 starts before softirq ->poll on cpu2
We could do lock-free recursion detection with:
dev->np->poll_owner = smp_processor_id().
This can replace the suggested np->poll_flag. This also helps with
case 2 where I'm currently doing trylock in netpoll. But this doesn't
help with case 3, and a solution that isn't the equivalent of a
spinlock doesn't jump out at me.
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2005-02-16 23:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-09 4:16 serious netpoll bug w/NAPI David S. Miller
2005-02-09 18:32 ` Matt Mackall
2005-02-10 0:46 ` David S. Miller
2005-02-10 1:11 ` Matt Mackall
2005-02-10 9:16 ` Martin Josefsson
2005-02-10 17:14 ` Matt Mackall
2005-02-15 22:49 ` Jeff Moyer
2005-02-16 5:07 ` Matt Mackall
2005-02-16 19:26 ` Jeff Moyer
2005-02-16 22:07 ` Jeff Moyer
2005-02-16 23:02 ` David S. Miller
2005-02-16 23:44 ` Matt Mackall [this message]
2005-02-16 23:54 ` David S. Miller
2005-02-17 0:15 ` Matt Mackall
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=20050216234406.GA3120@waste.org \
--to=mpm@selenic.com \
--cc=davem@davemloft.net \
--cc=jmoyer@redhat.com \
--cc=netdev@oss.sgi.com \
/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).