From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vlad Buslov Subject: Re: [PATCH net-next v2 05/10] net: sched: use Qdisc rcu API instead of relying on rtnl lock Date: Thu, 20 Sep 2018 10:20:58 +0300 Message-ID: References: <1537168660-24032-1-git-send-email-vladbu@mellanox.com> <1537168660-24032-6-git-send-email-vladbu@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Linux Kernel Network Developers , Jamal Hadi Salim , Jiri Pirko , David Miller , Stephen Hemminger , Kirill Tkhai , Nicolas Dichtel , Greg KH , mark.rutland@arm.com, Leon Romanovsky , "Paul E. McKenney" , Florian Westphal , David Ahern , christian@brauner.io, lucien xin , Jakub Kicinski , Jiri Benc To: Cong Wang Return-path: Received: from mail-eopbgr70053.outbound.protection.outlook.com ([40.107.7.53]:41120 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726014AbeITNDN (ORCPT ); Thu, 20 Sep 2018 09:03:13 -0400 In-reply-to: Sender: netdev-owner@vger.kernel.org List-ID: On Wed 19 Sep 2018 at 22:04, Cong Wang wrote: > On Mon, Sep 17, 2018 at 12:19 AM Vlad Buslov 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.