netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Vlad Buslov <vladbu@mellanox.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>, David Miller <davem@davemloft.net>
Subject: Re: [PATCH net 2/3] net: sched: multiq: don't call qdisc_put() while holding tree lock
Date: Wed, 18 Sep 2019 15:56:36 -0700	[thread overview]
Message-ID: <CAM_iQpV75h9npv2TbBMoRAMf+riPqJhAY2LaiVX-mrVGaUN-Kw@mail.gmail.com> (raw)
In-Reply-To: <20190918073201.2320-3-vladbu@mellanox.com>

On Wed, Sep 18, 2019 at 12:32 AM Vlad Buslov <vladbu@mellanox.com> wrote:
> diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c
> index e1087746f6a2..4cfa9a7bd29e 100644
> --- a/net/sched/sch_multiq.c
> +++ b/net/sched/sch_multiq.c
> @@ -187,18 +187,21 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt,
>
>         sch_tree_lock(sch);
>         q->bands = qopt->bands;
> +       sch_tree_unlock(sch);
> +
>         for (i = q->bands; i < q->max_bands; i++) {
>                 if (q->queues[i] != &noop_qdisc) {
>                         struct Qdisc *child = q->queues[i];
>
> +                       sch_tree_lock(sch);
>                         q->queues[i] = &noop_qdisc;
>                         qdisc_tree_flush_backlog(child);
> +                       sch_tree_unlock(sch);
> +
>                         qdisc_put(child);
>                 }
>         }

Repeatedly acquiring and releasing a spinlock in a loop
does not seem to be a good idea. Is it possible to save
those qdisc pointers to an array or something similar?

Thanks.

  reply	other threads:[~2019-09-18 22:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  7:31 [PATCH net 0/3] Fix Qdisc destroy issues caused by adding fine-grained locking to filter API Vlad Buslov
2019-09-18  7:31 ` [PATCH net 1/3] net: sched: sch_htb: don't call qdisc_put() while holding tree lock Vlad Buslov
2019-09-18  7:32 ` [PATCH net 2/3] net: sched: multiq: " Vlad Buslov
2019-09-18 22:56   ` Cong Wang [this message]
2019-09-19  8:56     ` Vlad Buslov
2019-09-18  7:32 ` [PATCH net 3/3] net: sched: sch_sfb: " Vlad Buslov
2019-09-18 22:50 ` [PATCH net 0/3] Fix Qdisc destroy issues caused by adding fine-grained locking to filter API Cong Wang
2019-09-19  8:53   ` Vlad Buslov
2019-09-19 19:13     ` Cong Wang

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=CAM_iQpV75h9npv2TbBMoRAMf+riPqJhAY2LaiVX-mrVGaUN-Kw@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=vladbu@mellanox.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).