From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [PATCH net-next v2 05/10] net: sched: use Qdisc rcu API instead of relying on rtnl lock Date: Wed, 19 Sep 2018 15:04:47 -0700 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; charset="UTF-8" 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: Vlad Buslov Return-path: Received: from mail-pl1-f193.google.com ([209.85.214.193]:34933 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733243AbeITDoz (ORCPT ); Wed, 19 Sep 2018 23:44:55 -0400 Received: by mail-pl1-f193.google.com with SMTP id g2-v6so3290381plo.2 for ; Wed, 19 Sep 2018 15:04:59 -0700 (PDT) In-Reply-To: <1537168660-24032-6-git-send-email-vladbu@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: 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?