From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next 03/13] net: sched: extend Qdisc with rcu Date: Thu, 6 Sep 2018 02:29:17 -0700 Message-ID: <1fa24b81-9dbc-419c-20e3-910ea548214b@gmail.com> References: <1536220742-25650-1-git-send-email-vladbu@mellanox.com> <1536220742-25650-4-git-send-email-vladbu@mellanox.com> <4a230727-1072-3bc9-1590-2e59c2162460@virtuozzo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, stephen@networkplumber.org, paulmck@linux.vnet.ibm.com, nicolas.dichtel@6wind.com, leon@kernel.org, gregkh@linuxfoundation.org, mark.rutland@arm.com, fw@strlen.de, dsahern@gmail.com, lucien.xin@gmail.com, jakub.kicinski@netronome.com, christian.brauner@ubuntu.com, jbenc@redhat.com To: Vlad Buslov , Kirill Tkhai Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:36439 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726541AbeIFOD4 (ORCPT ); Thu, 6 Sep 2018 10:03:56 -0400 Received: by mail-wm0-f66.google.com with SMTP id j192-v6so10529952wmj.1 for ; Thu, 06 Sep 2018 02:29:21 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 09/06/2018 02:23 AM, Vlad Buslov wrote: > > On Thu 06 Sep 2018 at 08:39, Kirill Tkhai wrote: >> On 06.09.2018 11:30, Eric Dumazet wrote: >>> >>> >>> On 09/06/2018 12:58 AM, Vlad Buslov wrote: >>> >>> ... >>> >>>> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h >>>> index 18e22a5a6550..239c73f29471 100644 >>>> --- a/include/net/sch_generic.h >>>> +++ b/include/net/sch_generic.h >>>> @@ -90,6 +90,7 @@ struct Qdisc { >>>> struct gnet_stats_queue __percpu *cpu_qstats; >>>> int padded; >>>> refcount_t refcnt; >>>> + struct rcu_head rcu; >>>> >>>> /* >>>> * For performance sake on SMP, we put highly modified fields at the end >>> >>> Probably better to move this at the end of struct Qdisc, >>> not risking unexpected performance regressions in fast path. >> >> Do you mean regressions on UP? On SMP it looks like this field >> fits in the unused gap created by: >> >> struct sk_buff_head gso_skb ____cacheline_aligned_in_smp; >> >> Kirill > > Hi Eric, Kirill > > I intentionally put rcu_head here in order for it not to be in same > cache line with "highly modified fields" (according to comment). My personal preference would have been to use the last cache line for a new 'control path field', and leave holes in the first one for future needs in fast path. But this is a minor detail really, either choice is fine.