From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next] net: sched: shrink struct Qdisc Date: Fri, 25 May 2018 16:41:28 +0200 Message-ID: <20180525144128.GA4288@nanopsycho.orion> References: <607936fe39bf1e78ca8b520e2ef25b7b326a767f.1527258390.git.pabeni@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, "David S. Miller" , Jamal Hadi Salim , Cong Wang To: Paolo Abeni Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:39737 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936093AbeEYOlp (ORCPT ); Fri, 25 May 2018 10:41:45 -0400 Received: by mail-wm0-f66.google.com with SMTP id f8-v6so15284957wmc.4 for ; Fri, 25 May 2018 07:41:45 -0700 (PDT) Content-Disposition: inline In-Reply-To: <607936fe39bf1e78ca8b520e2ef25b7b326a767f.1527258390.git.pabeni@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: Fri, May 25, 2018 at 04:28:44PM CEST, pabeni@redhat.com wrote: >The struct Qdisc has a lot of holes, especially after commit >a53851e2c321 ("net: sched: explicit locking in gso_cpu fallback"), >which as a side effect, moved the fields just after 'busylock' >on a new cacheline. > >Since both 'padded' and 'refcnt' are not updated frequently, and >there is a hole before 'gso_skb', we can move such fields there, >saving a cacheline without any performance side effect. > >Before this commit: > >pahole -C Qdisc net/sche/sch_generic.o > # ... > /* size: 384, cachelines: 6, members: 25 */ > /* sum members: 236, holes: 3, sum holes: 92 */ > /* padding: 56 */ > >After this commit: >pahole -C Qdisc net/sche/sch_generic.o > # ... > /* size: 320, cachelines: 5, members: 25 */ > /* sum members: 236, holes: 2, sum holes: 28 */ > /* padding: 56 */ > >Signed-off-by: Paolo Abeni Acked-by: Jiri Pirko