netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@o2.pl>
To: David Miller <davem@davemloft.net>
Cc: shemminger@linux-foundation.org, okir@lst.de, netdev@vger.kernel.org
Subject: Re: Races in net_rx_action vs netpoll?
Date: Tue, 24 Jul 2007 12:26:05 +0200	[thread overview]
Message-ID: <20070724102605.GC2049@ff.dom.local> (raw)
In-Reply-To: <20070722.000507.26966710.davem@davemloft.net>

On 22-07-2007 09:05, David Miller wrote:
> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Thu, 19 Jul 2007 17:27:47 +0100
> 
>> Please revisit the requirements that netconsole needs and redesign
>> it from scratch.  The existing code is causing too much breakage.
>>
>> Can it be done without breaking the semantics of network devices, or
>> should we rewrite the driver interface to take have a different
>> interface like netdev_sync_send_skb() that is slow, synchronous and
>> non-interrupt (ie polls for completion).  Of course, then people
>> will complain that netconsole traffic slows the machine down.  for
>> completion.
> 
> I couldn't agree more.
> 
> Since netpoll runs outside of all of the normal netdevice locking
> rules, only the people using netpoll hit all the bugs.  That means
> most of us do not test out these code path, which is bad.
> 
> So, if anything, a more integrated implementation is essential.
> 

But, IMHO, until this will be done some simpler measures could
do be done to make poll_napi less dangerous (as a matter of fact
I wonder why oopses observed & diagnosed by Olaf are so rare).

Current locking with netpoll_poll_lock is mainly misleading.
It seems somebody who planned napi didn't even think such helpers
as poll_napi are possible on other cpus and somebody doing netpoll
didn't want to show this all per cpu data needs full locking anyway.
But since it's like this there is no reason to invent a wheel again
and "normal" locking should be done: so global (not per device)
spin_lock (#ifdef CONFIG_NETPOLL only) held during all net_rx_action
and spin_trylock similarly in poll_napi (with STATE_RX_SCHED
re-checking) should be minimum needed here.

Regards,
Jarek P.

  reply	other threads:[~2007-07-24 10:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-04 12:16 Races in net_rx_action vs netpoll? Olaf Kirch
2007-07-09 22:27 ` David Miller
2007-07-10 10:44   ` Olaf Kirch
2007-07-11  5:44     ` David Miller
2007-07-11  7:41       ` Olaf Kirch
2007-07-12  2:33         ` David Miller
2007-07-19 15:19           ` Olaf Kirch
2007-07-19 16:27             ` Stephen Hemminger
2007-07-22  7:05               ` David Miller
2007-07-24 10:26                 ` Jarek Poplawski [this message]
2007-07-12 12:59     ` Jarek Poplawski
2007-07-12 13:54       ` Olaf Kirch
2007-07-13  8:55         ` Jarek Poplawski
2007-07-16  8:06           ` 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=20070724102605.GC2049@ff.dom.local \
    --to=jarkao2@o2.pl \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=okir@lst.de \
    --cc=shemminger@linux-foundation.org \
    /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).