From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [PATCH net-next 4/9] net: sctp: sctp_outq: consolidate chars into bitfield Date: Wed, 17 Apr 2013 17:38:06 +0200 Message-ID: <516EC1DE.6020209@redhat.com> References: <1366146438-8815-1-git-send-email-dborkman@redhat.com> <1366146438-8815-5-git-send-email-dborkman@redhat.com> <516E6ABD.2040904@redhat.com> <20130417152757.GD5149@hmsreliant.think-freely.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: David Laight , davem@davemloft.net, netdev@vger.kernel.org, linux-sctp@vger.kernel.org To: Neil Horman Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1781 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966823Ab3DQPiW (ORCPT ); Wed, 17 Apr 2013 11:38:22 -0400 In-Reply-To: <20130417152757.GD5149@hmsreliant.think-freely.org> Sender: netdev-owner@vger.kernel.org List-ID: On 04/17/2013 05:27 PM, Neil Horman wrote: > On Wed, Apr 17, 2013 at 11:26:21AM +0200, Daniel Borkmann wrote: >> On 04/17/2013 10:43 AM, David Laight wrote: >>>> __u32 outstanding_bytes; >>>> >>>> - /* Are we doing fast-rtx on this queue */ >>>> - char fast_rtx; >>>> - >>>> - /* Corked? */ >>>> - char cork; >>>> - >>>> - /* Is this structure empty? */ >>>> - char empty; >>>> + __u8 fast_rtx:1, /* Are we doing fast-rtx on this queue */ >>>> + cork:1, /* Corked? */ >>>> + empty:1; /* Is this structure empty? */ >>>> }; >>> >>> Use of bitfields just makes the code slower. >>> The only real excuse for using them is to reduce the size >>> of a structure that is allocated a lot. >> >> sctp_outq is _embedded_ into an sctp_association structure, which >> has [size: 2280, cachelines: 36, members: 76]! A next step would be >> to try to reorder its elements carefully and see if we can reduce >> the size by filling some holes. > Unrelated note: How did you get pahole to give you that information? For some > reason pahole can never glean any useful information about struct > sctp_association for me, despite having dwarf info embedded into the cu. I made a ``make net/sctp/'' and run pahole against net/sctp/sctp.o redirecting the output into a file, thus I have all possible headers visible.