netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: herbert@gondor.apana.org.au, netdev@vger.kernel.org, kaber@trash.net
Subject: Re: [PATCH take 2] pkt_sched: Fix qdisc_watchdog() vs. dev_deactivate() race
Date: Sun, 21 Sep 2008 11:57:06 +0200	[thread overview]
Message-ID: <20080921095705.GA2551@ami.dom.local> (raw)
In-Reply-To: <20080920.223538.130375517.davem@davemloft.net>

On Sat, Sep 20, 2008 at 10:35:38PM -0700, David Miller wrote:
> From: Jarek Poplawski <jarkao2@gmail.com>
> Date: Sun, 21 Sep 2008 01:48:43 +0200
> 
> > On Sat, Sep 20, 2008 at 12:21:37AM -0700, David Miller wrote:
> > ...
> > > Let's look at what actually matters for cpu utilization.  These
> > > __qdisc_run() things are invoked in two situations where we might
> > > block on the hw queue being stopped:
> > > 
> > > 1) When feeding packets into the qdisc in dev_queue_xmit().
>  ...
> > > 2) When waking up a queue.  And here we should schedule the qdisc_run
> > >    _unconditionally_.
>  ...
> > > The cpu utilization savings exist for case #1 only, and we can
> > > implement the bypass logic _perfectly_ as described above.
> > > 
> > > For #2 there is nothing to check, just do it and see what comes
> > > out of the qdisc.
> > 
> > Right, unless __netif_schedule() wasn't done when waking up. I've
> > thought about this because of another thread/patch around this
> > problem, and got misled by dev_requeue_skb() scheduling. Now, I think
> > this could be the main reason for this high load. Anyway, if we want
> > to skip this check for #2 I think something like the patch below is
> > needed.
> 
> Hmmm, looking at your patch....
> 
> It's only doing something new when the driver returns NETDEV_TX_BUSY
> from ->hard_start_xmit().
> 
> That _never_ happens in any sane driver.  That case is for buggy
> devices that do not maintain their TX queue state properly.  And
> in fact it's a case for which I advocate we just drop the packet
> instead of requeueing.  :-)

OK, then let's do it! Why I can't see this in your new patch?

> 
> Oh I see, you're concerned about that cases where qdisc_restart() ends
> up using the default initialization of the 'ret' variable.

Yes, this is my main concern.

> 
> Really, for the case where the driver actually returns NETDEV_TX_BUSY
> we _do_ want to unconditionally __netif_schedule(), since the device
> doesn't maintain it's queue state in the normal way.

So, do you advocate both to drop the packet and unconditionally
__netif_schedule()?!

> 
> Therefore it seems logical that what really needs to happen is that
> we simply pick some new local special token value for 'ret' so that
> we can handle that case.  "-1" would probably work fine.
> 
> So I'm dropping your patch.
> 
> I also think the qdisc_run() test needs to be there.  When the TX
> queue fills up, we will doing tons of completely useless work going:
> 
> 1) ->dequeue
> 2) qdisc unlock
> 3) TXQ lock
> 4) test state
> 5) TXQ unlock
> 6) qdisc lock
> 7) ->requeue
> 
> for EVERY SINGLE packet that is generated towards that device.
> 
> That has to be expensive,

I agree this useless work should be avoided, but only with a reliable
(and not too expensive) test. Your test might be done for the last
packet in the queue, while all the previous packets (and especially
the first one) have a different state of the queue. This should work
well for uniqueue devs and multiqueues with dedicated qdiscs, but is
doubtful for multiqueues with one qdisc, where it actually should be
most needed, because of potentially complex multiclass configs with
this new problem of blocking at the head-of-line (Alexander's main
concern).

BTW, since this problem is strongly conected with the requeuing
policy, I wonder why you seemingly lost interest in this. I tried to
advocate for your simple, one level requeuing, but also Herbert's
peek, and Alexander's early detection, after some polish(!), should
make this initial test meaningless.

> and I am still very much convinced that
> this was the original regression cause that made me put that TXQ
> state test back into qdisc_run().

I doubt this: I've just looked at this Andrew Gallatin's report, and
there is really a lot of net_tx_action, __netif_schedule, and guess
what: pfifo_fast_requeue in this oprofile...

Jarek P.

  parent reply	other threads:[~2008-09-21  9:56 UTC|newest]

Thread overview: 209+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 20:53 [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock() Jarek Poplawski
2008-08-12  1:12 ` David Miller
2008-08-12  5:20   ` Jarek Poplawski
2008-08-12  5:40     ` David Miller
2008-08-12  7:00       ` Jarek Poplawski
2008-08-12  8:15         ` David Miller
2008-08-12 10:38           ` Jarek Poplawski
2008-08-13  4:30           ` Herbert Xu
2008-08-13  5:11             ` David Miller
2008-08-13  5:31               ` Herbert Xu
2008-08-13  9:30                 ` David Miller
2008-08-13  6:13               ` Jarek Poplawski
2008-08-13  6:16                 ` David Miller
2008-08-13  6:53                   ` Jarek Poplawski
2008-08-13  7:31                     ` Jarek Poplawski
2008-08-13  9:25                     ` David Miller
2008-08-13  9:58                       ` Herbert Xu
2008-08-13 10:27                       ` Jarek Poplawski
2008-08-13 10:42                         ` Jarek Poplawski
2008-08-13 10:42                         ` Herbert Xu
2008-08-13 10:50                           ` Jarek Poplawski
2008-08-13 22:19                             ` David Miller
2008-08-14  7:59                               ` Jarek Poplawski
2008-08-14  8:16                                 ` Herbert Xu
2008-08-14  8:31                                   ` Jarek Poplawski
2008-08-14  8:33                                     ` Herbert Xu
2008-08-14  8:44                                       ` Jarek Poplawski
2008-08-14  8:52                                         ` Jarek Poplawski
2008-08-17 22:57                                           ` David Miller
2008-08-17 23:03                                             ` David Miller
2008-08-18  1:25                                               ` Herbert Xu
2008-08-18  1:35                                                 ` David Miller
2008-08-18  1:36                                                   ` Herbert Xu
2008-08-18  1:49                                                     ` David Miller
2008-08-18  4:27                                                       ` Herbert Xu
2008-08-18  4:31                                                         ` David Miller
2008-08-18  4:36                                                           ` Herbert Xu
2008-08-18  5:13                                                             ` David Miller
2008-08-18  6:08                                                               ` Denys Fedoryshchenko
2008-08-18  6:13                                                                 ` David Miller
2008-08-18  6:27                                                       ` Jarek Poplawski
2008-08-18  6:38                                                         ` David Miller
2008-08-18 21:29                                                       ` Jarek Poplawski
2008-08-18 23:47                                                         ` David Miller
2008-08-19 10:31                                                           ` Jarek Poplawski
2008-08-19 10:51                                                             ` Herbert Xu
2008-08-19 10:54                                                               ` David Miller
2008-08-19 10:55                                                                 ` Herbert Xu
2008-08-19 10:58                                                                   ` Herbert Xu
2008-08-19 11:02                                                                     ` David Miller
2008-08-19 11:11                                                                       ` Herbert Xu
2008-08-19 16:48                                                                       ` Jarek Poplawski
2008-08-19 22:23                                                                         ` Herbert Xu
2008-08-20 11:56                                                                           ` [PATCH] pkt_sched: Fix qdisc_watchdog() vs. dev_deactivate() race Jarek Poplawski
2008-08-20 12:16                                                                             ` Herbert Xu
2008-08-21  5:17                                                                             ` Jarek Poplawski
2008-08-21  5:49                                                                           ` [PATCH take 2] " Jarek Poplawski
2008-08-21  6:10                                                                             ` Herbert Xu
2008-08-21  6:49                                                                               ` Jarek Poplawski
2008-08-21  7:16                                                                                 ` Herbert Xu
2008-08-21  7:52                                                                                   ` David Miller
2008-08-21  8:00                                                                                     ` Herbert Xu
2008-08-21  8:27                                                                                     ` Jarek Poplawski
2008-08-21  8:35                                                                                       ` Jarek Poplawski
2008-08-21  8:47                                                                                         ` Jarek Poplawski
2008-09-11 10:39                                                                                     ` David Miller
2008-09-11 10:45                                                                                       ` Herbert Xu
2008-09-11 10:49                                                                                         ` David Miller
2008-09-11 11:00                                                                                           ` Herbert Xu
2008-09-11 11:42                                                                                             ` David Miller
2008-09-11 11:45                                                                                               ` Herbert Xu
2008-09-11 11:47                                                                                                 ` David Miller
2008-09-12  4:49                                                                                                   ` David Miller
2008-09-12  8:02                                                                                                     ` Jarek Poplawski
2008-09-12 23:10                                                                                                       ` David Miller
2008-09-13  1:10                                                                                                         ` Herbert Xu
2008-09-13  1:22                                                                                                           ` David Miller
2008-09-13  1:27                                                                                                             ` Herbert Xu
2008-09-13  1:40                                                                                                               ` David Miller
2008-09-13  1:48                                                                                                                 ` Herbert Xu
2008-09-13 20:54                                                                                                                   ` Jarek Poplawski
2008-09-14  6:16                                                                                                                     ` Herbert Xu
2008-09-14 10:31                                                                                                                       ` Alexander Duyck
2008-09-14 21:43                                                                                                                         ` Jarek Poplawski
2008-09-14 22:13                                                                                                                           ` Herbert Xu
2008-09-15  6:07                                                                                                                             ` Jarek Poplawski
2008-09-15  6:19                                                                                                                               ` Herbert Xu
2008-09-15  7:20                                                                                                                                 ` Jarek Poplawski
2008-09-15  7:45                                                                                                                                   ` Jarek Poplawski
2008-09-15 23:44                                                                                                                                     ` Duyck, Alexander H
2008-09-16 10:47                                                                                                                                       ` Jarek Poplawski
2008-09-17  2:31                                                                                                                                         ` Alexander Duyck
2008-09-14 11:56                                                                                                                       ` jamal
2008-09-14 20:27                                                                                                                       ` Jarek Poplawski
2008-09-20  7:21                                                                                                                         ` David Miller
2008-09-20  7:25                                                                                                                           ` Herbert Xu
2008-09-20  7:28                                                                                                                             ` David Miller
2008-09-20 23:48                                                                                                                           ` Jarek Poplawski
2008-09-21  5:35                                                                                                                             ` David Miller
2008-09-21  5:50                                                                                                                               ` David Miller
2008-09-21  6:38                                                                                                                                 ` Herbert Xu
2008-09-21  7:03                                                                                                                                   ` David Miller
2008-09-23  6:23                                                                                                                                     ` Herbert Xu
2008-09-24  7:15                                                                                                                                       ` Jarek Poplawski
2008-09-24  8:04                                                                                                                                         ` Herbert Xu
2008-09-24  8:28                                                                                                                                           ` Jarek Poplawski
2008-09-21 15:25                                                                                                                                 ` Jarek Poplawski
2008-09-21  9:57                                                                                                                               ` Jarek Poplawski [this message]
2008-09-21 10:18                                                                                                                                 ` David Miller
2008-09-21 11:15                                                                                                                                   ` Jarek Poplawski
2008-09-23  5:16                                                                                                                                     ` David Miller
2008-09-23  8:02                                                                                                                                       ` Jarek Poplawski
2008-09-23  8:06                                                                                                                                         ` David Miller
2008-09-11 11:51                                                                                             ` Jarek Poplawski
2008-09-11 11:54                                                                                               ` Herbert Xu
2008-09-11 12:10                                                                                                 ` Jarek Poplawski
2008-09-11 12:34                                                                                                 ` Jarek Poplawski
2008-08-21 12:11                                                                             ` David Miller
2008-08-14  8:17                               ` [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock() Jarek Poplawski
2008-08-14 11:24                               ` Jarek Poplawski
2008-08-17 13:42                                 ` Jarek Poplawski
2008-08-17 21:34                                   ` David Miller
2008-08-17 22:22                                     ` Jarek Poplawski
2008-08-17 22:32                                       ` David Miller
2008-08-18 20:12                                         ` Jarek Poplawski
2008-08-18 23:54                                           ` David Miller
2008-08-19  0:05                                             ` Herbert Xu
2008-08-19  0:11                                               ` David Miller
2008-08-19  4:07                                                 ` David Miller
2008-08-19  5:27                                                   ` Ilpo Järvinen
2008-08-19  5:30                                                     ` David Miller
2008-08-19  6:46                                                   ` Jarek Poplawski
2008-08-19  7:03                                                     ` David Miller
2008-08-19  7:23                                                       ` Jarek Poplawski
2008-08-19  7:23                                                     ` Herbert Xu
2008-08-19  7:35                                                       ` Jarek Poplawski
2008-08-19  7:46                                                         ` Herbert Xu
2008-08-19  7:56                                                           ` Jarek Poplawski
2008-08-19  8:05                                                             ` Herbert Xu
2008-08-19  8:17                                                               ` Jarek Poplawski
2008-08-19  8:23                                                                 ` Herbert Xu
2008-08-19  8:32                                                                   ` David Miller
2008-08-19  8:41                                                                     ` Jarek Poplawski
2008-08-19  8:48                                                                       ` David Miller
2008-08-19  8:50                                                                     ` Herbert Xu
2008-08-19  8:39                                                                   ` Jarek Poplawski
2008-08-19  8:55                                                                     ` Herbert Xu
2008-08-19  9:16                                                                       ` Jarek Poplawski
2008-08-21 10:01                                                                         ` Jarek Poplawski
2008-08-21 10:05                                                                           ` David Miller
2008-08-21 10:11                                                                             ` Jarek Poplawski
2008-08-21 10:18                                                                               ` Jarek Poplawski
2008-08-21 10:21                                                                                 ` Herbert Xu
2008-08-21 10:23                                                                                   ` Herbert Xu
2008-08-21 10:33                                                                                     ` Jarek Poplawski
2008-08-21 10:51                                                                                       ` Herbert Xu
2008-08-21 11:20                                                                                         ` Jarek Poplawski
2008-08-21 11:26                                                                                           ` Herbert Xu
2008-08-21 11:55                                                                                             ` Jarek Poplawski
2008-08-21 12:01                                                                                               ` Herbert Xu
2008-08-21 12:19                                                                                                 ` Jarek Poplawski
2008-08-21 12:22                                                                                                   ` Herbert Xu
2008-08-21 12:27                                                                                                     ` David Miller
2008-08-21 12:35                                                                                                       ` Herbert Xu
2008-08-21 12:48                                                                                                         ` Herbert Xu
2008-08-21 12:55                                                                                                           ` Jarek Poplawski
2008-08-21 13:12                                                                                                             ` Herbert Xu
2008-08-21 18:58                                                                                                               ` Jarek Poplawski
2008-08-21 21:14                                                                                                                 ` Jarek Poplawski
2008-08-21 22:23                                                                                                                 ` Herbert Xu
2008-08-22  8:49                                                                                                                   ` Jarek Poplawski
2008-08-22  8:55                                                                                                                     ` David Miller
2008-08-22 10:07                                                                                                                       ` Herbert Xu
2008-08-22 10:27                                                                                                                         ` David Miller
2008-08-22 11:02                                                                                                                           ` Herbert Xu
2008-08-22 11:38                                                                                                                   ` Jarek Poplawski
2008-08-22 11:42                                                                                                                     ` David Miller
2008-08-22 12:09                                                                                                                       ` Jarek Poplawski
2008-08-22 12:11                                                                                                                         ` Herbert Xu
2008-08-22 12:18                                                                                                                           ` David Miller
2008-08-22 12:45                                                                                                                             ` Herbert Xu
2008-08-24 23:26                                                                                                                               ` Stephen Hemminger
2008-08-24 23:49                                                                                                                                 ` Herbert Xu
2008-08-25  0:29                                                                                                                                   ` Stephen Hemminger
2008-08-26  7:35                                                                                                                                     ` Herbert Xu
2008-08-26  7:47                                                                                                                                       ` Herbert Xu
2008-08-26 12:24                                                                                                                                         ` Stephen Hemminger
2008-08-26 12:41                                                                                                                                           ` Herbert Xu
2008-08-26 12:50                                                                                                                                             ` Stephen Hemminger
2008-08-26 12:56                                                                                                                                               ` Herbert Xu
2008-08-27 12:17                                                                                                                                               ` Bastian Bloessl
2008-08-27  9:32                                                                                                                                         ` David Miller
2008-08-27  9:56                                                                                                                                           ` Herbert Xu
2008-08-22 12:25                                                                                                                           ` Jarek Poplawski
2008-08-23 12:15                                                                                                                 ` David Miller
2008-08-21 20:40                                                                                                           ` Jarek Poplawski
2008-08-21 22:24                                                                                                             ` Herbert Xu
2008-08-22  8:41                                                                                                               ` [PATCH] pkt_sched: Fix qdisc list locking Jarek Poplawski
2008-08-22 10:14                                                                                                                 ` Herbert Xu
2008-08-22  9:27                                                                                                               ` [PATCH take 2] " Jarek Poplawski
2008-08-22 10:15                                                                                                                 ` Herbert Xu
2008-08-22 10:28                                                                                                                   ` David Miller
2008-08-22 10:23                                                                                                                 ` David Miller
2008-08-21 12:49                                                                                                         ` [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock() Jarek Poplawski
2008-08-21 12:51                                                                                                           ` Herbert Xu
2008-08-21 12:06                                                                                               ` David Miller
2008-08-21 10:18                                                                           ` Herbert Xu
2008-08-12 22:02 ` [PATCH take 2] pkt_sched: Protect gen estimators under est_lock Jarek Poplawski
2008-08-13 22:20   ` 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=20080921095705.GA2551@ami.dom.local \
    --to=jarkao2@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kaber@trash.net \
    --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).