From: Stephen Hemminger <shemminger@osdl.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] netpoll: rework skb transmit queue
Date: Fri, 20 Oct 2006 13:48:26 -0700 [thread overview]
Message-ID: <20061020134826.75dd1cba@freekitty> (raw)
In-Reply-To: <20061020.134209.85688168.davem@davemloft.net>
On Fri, 20 Oct 2006 13:42:09 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@osdl.org>
> Date: Fri, 20 Oct 2006 08:40:15 -0700
>
> > -static void queue_process(void *p)
> > +static void netpoll_run(unsigned long arg)
> > {
> ...
> > - spin_unlock_irqrestore(&queue_lock, flags);
> > + netif_tx_lock(dev);
> > + if (netif_queue_stopped(dev) ||
> > + dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) {
> > + skb_queue_head(&npinfo->tx_q, skb);
> > + netif_tx_unlock(dev);
> > + tasklet_schedule(&npinfo->tx_task);
> > + return;
> > + }
>
> We really can't handle TX stopped this way from the netpoll_send_skb()
> path. All that old retry logic in netpoll_send_skb() is really
> necessary.
>
> If we are in deep IRQ context, took an OOPS, and are trying to get a
> netpoll packet out for the kernel log message, we have to try as hard
> as possible to get the packet out then and there, even if that means
> waiting some amount of time for netif_queue_stopped() to become false.
>
But, it also violates the assumptions of the network devices.
It calls NAPI poll back with IRQ's disabled and potentially doesn't
obey the semantics about only running on the same CPU as the
received packet.
> That is what the existing code is trying to do.
>
> If you defer to a tasklet, the kernel state from the OOPS can be so
> corrupted that the tasklet will never run and we'll never get the
> netconsole message needed to debug the problem.
So we can try once and if that fails we have to defer to tasklet.
We can't call NAPI, we can't try and cleanup the device will need
an IRQ to get unblocked.
Or add another device callback that just to handle that case.
> Also, if we tasklet schedule from the tasklet, we'll just keep looping
> in the tasklet and never leave softirq context, which is also bad
> behavior. Even in the tasklet, we should spin and poll when possible
> like the current netpoll_send_skb() code does.
>
> So we really can't apply this patch.
--
Stephen Hemminger <shemminger@osdl.org>
next prev parent reply other threads:[~2006-10-20 20:48 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-19 17:15 [PATCH 0/3] netpoll/netconsole fixes Stephen Hemminger
2006-10-19 17:15 ` [PATCH 1/3] netpoll: initialize skb for UDP Stephen Hemminger
2006-10-20 6:58 ` David Miller
2006-10-19 17:15 ` [PATCH 2/3] netpoll: rework skb transmit queue Stephen Hemminger
2006-10-20 7:15 ` David Miller
2006-10-20 15:18 ` Stephen Hemminger
2006-10-20 19:24 ` David Miller
2006-10-20 19:25 ` Stephen Hemminger
2006-10-20 19:52 ` David Miller
2006-10-20 20:14 ` Stephen Hemminger
2006-10-20 20:25 ` Stephen Hemminger
2006-10-21 5:00 ` Dave Jones
2006-10-21 6:38 ` David Miller
2006-10-20 15:40 ` Stephen Hemminger
2006-10-20 19:27 ` David Miller
2006-10-20 19:31 ` Stephen Hemminger
2006-10-20 20:42 ` David Miller
2006-10-20 20:48 ` Stephen Hemminger [this message]
2006-10-20 21:01 ` Andi Kleen
2006-10-20 21:08 ` David Miller
2006-10-20 21:16 ` Andi Kleen
2006-10-20 21:41 ` Stephen Hemminger
2006-10-20 21:01 ` David Miller
2006-10-20 22:30 ` [PATCH 1/3] netpoll: use sk_buff_head for txq Stephen Hemminger
2006-10-23 3:42 ` David Miller
2006-10-23 19:02 ` [PATCH 1/5] " Stephen Hemminger
2006-10-23 19:04 ` [PATCH 5/5] netpoll: interface cleanup Stephen Hemminger
2006-10-24 6:03 ` [PATCH 1/5] netpoll: use sk_buff_head for txq David Miller
2006-10-24 14:51 ` Stephen Hemminger
[not found] ` <20061023115111.0d69846e@dxpl.pdx.osdl.net>
2006-10-23 19:02 ` [PATCH 2/5] netpoll: cleanup queued transmit Stephen Hemminger
[not found] ` <20061023115337.1f636ffb@dxpl.pdx.osdl.net>
2006-10-23 19:02 ` [PATCH 4/5] netpoll: move drop hook inline Stephen Hemminger
2006-10-23 19:03 ` [PATCH 3/5] netpoll: cleanup transmit retry logic Stephen Hemminger
2006-10-20 22:32 ` [PATCH 2/3] netpoll: use device xmit directly Stephen Hemminger
2006-10-20 22:35 ` [PATCH 3/3] netpoll: retry logic cleanup Stephen Hemminger
2006-10-19 17:15 ` [PATCH 3/3] netpoll: use skb_buff_head for skb cache Stephen Hemminger
2006-10-20 6:57 ` [PATCH 0/3] netpoll/netconsole fixes Andrew Morton
2006-10-20 7:16 ` David Miller
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=20061020134826.75dd1cba@freekitty \
--to=shemminger@osdl.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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).