[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpWQU0aG5XK=aWsSY-GVn1CNcRk5H+aB5Ph6MG1Lw6FVvA@mail.gmail.com>
Date: Fri, 21 Sep 2018 12:29:39 -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>,
Stephen Hemminger <stephen@...workplumber.org>,
Kirill Tkhai <ktkhai@...tuozzo.com>,
Nicolas Dichtel <nicolas.dichtel@...nd.com>,
Greg KH <gregkh@...uxfoundation.org>, mark.rutland@....com,
Leon Romanovsky <leon@...nel.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Florian Westphal <fw@...len.de>,
David Ahern <dsahern@...il.com>, christian@...uner.io,
lucien xin <lucien.xin@...il.com>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
Jiri Benc <jbenc@...hat.com>
Subject: Re: [PATCH net-next v2 05/10] net: sched: use Qdisc rcu API instead
of relying on rtnl lock
On Thu, Sep 20, 2018 at 12:21 AM Vlad Buslov <vladbu@...lanox.com> wrote:
>
>
> On Wed 19 Sep 2018 at 22:04, Cong Wang <xiyou.wangcong@...il.com> wrote:
> > On Mon, Sep 17, 2018 at 12:19 AM Vlad Buslov <vladbu@...lanox.com> wrote:
> >> +static void tcf_qdisc_put(struct Qdisc *q, bool rtnl_held)
> >> +{
> >> + if (!q)
> >> + return;
> >> +
> >> + if (rtnl_held)
> >> + qdisc_put(q);
> >> + else
> >> + qdisc_put_unlocked(q);
> >> +}
> >
> > This is very ugly. You should know whether RTNL is held or
> > not when calling it.
> >
> > What's more, all of your code passes true, so why do you
> > need a parameter for rtnl_held?
>
> It passes true because currently rule update handlers still registered
> as locked. This is a preparation for next patch set where this would be
> changed to proper variable that depends on qdics and classifier type.
You can always add it when you really need it.
I doubt you need such a tiny wrapper even in the next patchset,
as it can be easily folded into callers.
Powered by blists - more mailing lists