From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [RFC PATCH 01/13] net: sched: allow qdiscs to handle locking Date: Wed, 17 Aug 2016 15:33:00 -0700 Message-ID: <1471473180.29842.44.camel@edumazet-glaptop3.roam.corp.google.com> References: <20160817193120.27032.20918.stgit@john-Precision-Tower-5810> <20160817193338.27032.71493.stgit@john-Precision-Tower-5810> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: xiyou.wangcong@gmail.com, jhs@mojatatu.com, alexei.starovoitov@gmail.com, brouer@redhat.com, john.r.fastabend@intel.com, netdev@vger.kernel.org, davem@davemloft.net To: John Fastabend Return-path: Received: from mail-pa0-f68.google.com ([209.85.220.68]:33851 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435AbcHQWdD (ORCPT ); Wed, 17 Aug 2016 18:33:03 -0400 Received: by mail-pa0-f68.google.com with SMTP id hh10so158587pac.1 for ; Wed, 17 Aug 2016 15:33:03 -0700 (PDT) In-Reply-To: <20160817193338.27032.71493.stgit@john-Precision-Tower-5810> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 2016-08-17 at 12:33 -0700, John Fastabend wrote: > This patch adds a flag for queueing disciplines to indicate the stack > does not need to use the qdisc lock to protect operations. This can > be used to build lockless scheduling algorithms and improving > performance. > > The flag is checked in the tx path and the qdisc lock is only taken > if it is not set. For now use a conditional if statement. Later we > could be more aggressive if it proves worthwhile and use a static key > or wrap this in a likely(). > > Signed-off-by: John Fastabend > --- > include/net/pkt_sched.h | 4 +++- > include/net/sch_generic.h | 1 + > net/core/dev.c | 32 ++++++++++++++++++++++++++++---- > net/sched/sch_generic.c | 26 ++++++++++++++++---------- > 4 files changed, 48 insertions(+), 15 deletions(-) > > diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h > index 7caa99b..69540c6 100644 > --- a/include/net/pkt_sched.h > +++ b/include/net/pkt_sched.h > @@ -107,8 +107,10 @@ void __qdisc_run(struct Qdisc *q); > > static inline void qdisc_run(struct Qdisc *q) > { > - if (qdisc_run_begin(q)) > + if (qdisc_run_begin(q)) { > __qdisc_run(q); > + qdisc_run_end(q); > + } > } Looks like you could have a separate patch, removing qdisc_run_end() call done in __qdisc_run(q) ? Then the 'allow qdiscs to handle locking'