From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch net-next v3 2/2] net: core: introduce mini_Qdisc and eliminate usage of tp->q for clsact fastpath Date: Thu, 2 Nov 2017 12:27:28 +0100 Message-ID: <20171102112728.GB2024@nanopsycho> References: <20171031151222.5021-1-jiri@resnulli.us> <20171031151222.5021-3-jiri@resnulli.us> <20171101021248.624bvt5jcqr37w5e@ast-mbp> <20171101081803.GB1977@nanopsycho.orion> <20171101161112.hpzl2a5oi5tdvauo@ast-mbp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, mlxsw@mellanox.com, edumazet@google.com, daniel@iogearbox.net, alexander.h.duyck@intel.com, willemb@google.com, john.fastabend@gmail.com To: Alexei Starovoitov Return-path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:45253 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753883AbdKBL1a (ORCPT ); Thu, 2 Nov 2017 07:27:30 -0400 Received: by mail-wm0-f65.google.com with SMTP id y80so10328366wmd.0 for ; Thu, 02 Nov 2017 04:27:30 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20171101161112.hpzl2a5oi5tdvauo@ast-mbp> Sender: netdev-owner@vger.kernel.org List-ID: Wed, Nov 01, 2017 at 05:11:14PM CET, alexei.starovoitov@gmail.com wrote: >On Wed, Nov 01, 2017 at 09:18:03AM +0100, Jiri Pirko wrote: >> Wed, Nov 01, 2017 at 03:12:50AM CET, alexei.starovoitov@gmail.com wrote: >> >On Tue, Oct 31, 2017 at 04:12:22PM +0100, Jiri Pirko wrote: >> >> From: Jiri Pirko >> >> >> >> In sch_handle_egress and sch_handle_ingress tp->q is used only in order >> >> to update stats. So stats and filter list are the only things that are >> >> needed in clsact qdisc fastpath processing. Introduce new mini_Qdisc >> >> struct to hold those items. Also, introduce a helper to swap the >> >> mini_Qdisc structures in case filter list head changes. >> >> >> >> This removes need for tp->q usage without added overhead. >> >> >> >> Signed-off-by: Jiri Pirko >> >> --- >> >> v2->v3: >> >> - Using head change callback to replace miniq pointer every time tp head >> >> changes. This eliminates one rcu dereference and makes the claim "without >> >> added overhead" valid. >> > >> >you kidding, right? >> >It's still two loads. >> >> I'm not. >> I replace: >> >> one rcu_dereference_bh(dev->egress_cl_list) >> by one rcu_dereference_bh(dev->miniq_egress) >> >> one dereference cl->q >> by one dereference miniq->filter_list >> >> What do I miss? > >that in assembler code they are the same when debug is off ? Pardon my ignorance, but I don't get your point :( Could you please elaborate a bit more? Thanks!