From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH net-next v2] net: core: change bool members of struct net_device to bitfield members Date: Tue, 9 Oct 2018 09:20:10 -0600 Message-ID: <35349fe9-94ac-e2d0-f02c-078c9fd58090@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "netdev@vger.kernel.org" To: Heiner Kallweit , David Miller Return-path: Received: from mail-pg1-f195.google.com ([209.85.215.195]:36100 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbeJIWhi (ORCPT ); Tue, 9 Oct 2018 18:37:38 -0400 Received: by mail-pg1-f195.google.com with SMTP id f18-v6so982538pgv.3 for ; Tue, 09 Oct 2018 08:20:13 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/8/18 2:17 PM, Heiner Kallweit wrote: > bool is good as parameter type or function return type, but if used > for struct members it consumes more memory than needed. > Changing the bool members of struct net_device to bitfield members > allows to decrease the memory footprint of this struct. What does pahole show for the size of the struct before and after? I suspect you have not really changed the size and certainly not the actual memory allocated.