netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Sutter <phil@nwl.cc>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Stephen Hemminger <shemming@brocade.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	David Ahern <dsa@cumulusnetworks.com>,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>,
	Julien Floret <julien.floret@6wind.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [iproute PATCH v3 0/6] Big C99 style initializer rework
Date: Fri, 24 Jun 2016 13:47:53 +0200	[thread overview]
Message-ID: <20160624114753.GB28345@orbyte.nwl.cc> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6D5F4E3E8D@AcuExch.aculab.com>

Hi,

On Fri, Jun 24, 2016 at 09:17:07AM +0000, David Laight wrote:
> From: Phil Sutter
> > Sent: 23 June 2016 18:34
> >
> > This is v3 of my C99-style initializer related patch series.
> ...
> 
> It would be interesting to know how this affect the kernel code size?
> 
> While gcc will generate a memset() call for 'struct foo = {0}' if you
> initialise some members it might generate explicit zeroing instructions
> for all the other words of the structure.
> 
> I've seen gcc use memset() to zero the end of a structure, it may use
> memset() for large gaps earlier in the structure.
> 
> But if you initialise a byte half way down you are very unlikely to
> get a single memset() and then a write to the single location.

I did a standard build ('make distclean; make') before and after this
commit in my tree. The 'ip' binary didn't change in size at all (quite
surprising), the 'tc' binary shrunk by 48 bytes.

Cheers, Phil

  reply	other threads:[~2016-06-24 11:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 17:34 [iproute PATCH v3 0/6] Big C99 style initializer rework Phil Sutter
2016-06-23 17:34 ` [iproute PATCH v3 1/6] tc: m_action: Improve conversion to C99 style initializers Phil Sutter
2016-06-23 17:34 ` [iproute PATCH v3 2/6] Use C99 style initializers everywhere Phil Sutter
2016-06-23 17:34 ` [iproute PATCH v3 3/6] Replace malloc && memset by calloc Phil Sutter
2016-06-23 17:34 ` [iproute PATCH v3 4/6] No need to initialize rtattr fields before parsing Phil Sutter
2016-06-23 17:34 ` [iproute PATCH v3 5/6] Makefile: Allow to override CC Phil Sutter
2016-06-23 17:34 ` [iproute PATCH v3 6/6] misc/ifstat: simplify unsigned value comparison Phil Sutter
2016-06-24  9:20   ` David Laight
2016-06-24 11:55     ` Phil Sutter
2016-06-24  9:17 ` [iproute PATCH v3 0/6] Big C99 style initializer rework David Laight
2016-06-24 11:47   ` Phil Sutter [this message]
2016-06-24 13:12 ` Nicolas Dichtel
     [not found] <d6784d8bb2d84ceab6c1719e32e8fa8e@HQ1WP-EXMB11.corp.brocade.com>
2016-06-27 17:59 ` Stephen Hemminger
2016-06-27 18:23   ` Phil Sutter
2016-06-27 21:10     ` Stephen Hemminger
2016-06-28 17:37       ` Phil Sutter
2016-06-28 17:37         ` David Ahern
2016-06-28 17:58           ` Phil Sutter
2016-06-28 17:59             ` David Ahern
2016-06-28 18:07               ` Phil Sutter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160624114753.GB28345@orbyte.nwl.cc \
    --to=phil@nwl.cc \
    --cc=David.Laight@ACULAB.COM \
    --cc=daniel@iogearbox.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=julien.floret@6wind.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=shemming@brocade.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).