netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: John Fastabend <john.fastabend@gmail.com>,
	Networking <netdev@vger.kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>
Subject: Re: [BUG] net/sched : qlen can not really be per cpu ?
Date: Wed, 27 Feb 2019 21:15:52 -0800	[thread overview]
Message-ID: <e3bcab30-a7a4-878b-9d00-d1fa39b1f4e9@gmail.com> (raw)
In-Reply-To: <CAM_iQpU-gVA-p7-R0VoEv0HJ6sSmkBn805obwYAszfeMSB8TSw@mail.gmail.com>



On 02/27/2019 06:46 PM, Cong Wang wrote:

> Hmm, looking into this, do we really need to check cl->leaf.q->q.qlen
> in htb_activate() for pfifo_fast? htb_activate() is only called when
> qdisc_enqueue() returns NET_XMIT_SUCCESS, so for pfifo_fast
> that is always qlen!=0, right?
> 
> So something like below? It is ugly but should be sufficient to shut
> up the warning.
> 
> diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
> index 30f9da7e1076..6d0182750f8b 100644
> --- a/net/sched/sch_htb.c
> +++ b/net/sched/sch_htb.c
> @@ -555,7 +555,8 @@ htb_change_class_mode(struct htb_sched *q, struct
> htb_class *cl, s64 *diff)
>   */
>  static inline void htb_activate(struct htb_sched *q, struct htb_class *cl)
>  {
> -       WARN_ON(cl->level || !cl->leaf.q || !cl->leaf.q->q.qlen);
> +       WARN_ON(cl->level || !cl->leaf.q ||
> +               (!(cl->leaf.q->flags & TCQ_F_NOLOCK) && !cl->leaf.q->q.qlen));
> 
>         if (!cl->prio_activity) {
>                 cl->prio_activity = 1 << cl->prio;
> 

Well, this is the tip of the iceberg.

Look at lines 845 & 883

How are we going to fix them ?

(Then there are all the other qdisc I mentioned)


      reply	other threads:[~2019-02-28  5:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-26  6:42 [BUG] net/sched : qlen can not really be per cpu ? Eric Dumazet
2019-02-26 23:19 ` Eric Dumazet
2019-02-26 23:51   ` Cong Wang
2019-02-27  0:56     ` Eric Dumazet
2019-02-27 16:59       ` Eric Dumazet
2019-02-28  2:46       ` Cong Wang
2019-02-28  5:15         ` Eric Dumazet [this message]

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=e3bcab30-a7a4-878b-9d00-d1fa39b1f4e9@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.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).