From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH net-next v2] net: core: change bool members of struct net_device to bitfield members Date: Tue, 9 Oct 2018 13:52:22 -0700 Message-ID: References: <35349fe9-94ac-e2d0-f02c-078c9fd58090@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" , David Laight To: Heiner Kallweit , David Ahern , David Miller Return-path: Received: from mail-lf1-f65.google.com ([209.85.167.65]:46788 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727467AbeJJELO (ORCPT ); Wed, 10 Oct 2018 00:11:14 -0400 Received: by mail-lf1-f65.google.com with SMTP id z144-v6so2321900lff.13 for ; Tue, 09 Oct 2018 13:52:27 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/09/2018 01:24 PM, Heiner Kallweit wrote: > Reordering the struct members to fill the holes could be a little tricky > and could have side effects because it may make a performance difference > whether certain members are in one cacheline or not. > And whether it's worth to spend this effort (incl. the related risks) > just to save a few bytes (also considering that typically we have quite > few instances of struct net_device)? Not really. In fact we probably should spend time reordering fields for performance, since some new fields were added a bit randomly, breaking the goal of data locality. Some fields are used in control path only can could be moved out of the cache lines needed in data path (fast path).