[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpV75h9npv2TbBMoRAMf+riPqJhAY2LaiVX-mrVGaUN-Kw@mail.gmail.com>
Date: Wed, 18 Sep 2019 15:56:36 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Vlad Buslov <vladbu@...lanox.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH net 2/3] net: sched: multiq: don't call qdisc_put() while
holding tree lock
On Wed, Sep 18, 2019 at 12:32 AM Vlad Buslov <vladbu@...lanox.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.
Powered by blists - more mailing lists