From: Joe Perches <joe@perches.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev <netdev@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 net-next] udp: Neaten and reduce size of compute_score functions
Date: Mon, 01 Dec 2014 21:26:15 -0800 [thread overview]
Message-ID: <1417497975.4894.16.camel@perches.com> (raw)
In-Reply-To: <1417496925.5303.18.camel@edumazet-glaptop2.roam.corp.google.com>
On Mon, 2014-12-01 at 21:08 -0800, Eric Dumazet wrote:
> On Mon, 2014-12-01 at 20:29 -0800, Joe Perches wrote:
> > The compute_score functions are a bit difficult to read.
> >
> > Neaten them a bit to reduce object sizes and make them a
> > bit more intelligible.
> >
> > Return early to avoid indentation and avoid unnecessary
> > initializations.
> >
> > (allyesconfig, but w/ -O2 and no profiling)
>
> hmm... Not sure how you get such large numbers...
Nor I particularly, but I do with gcc 4.9.1
> > $ size net/ipv[46]/udp.o.*
> > text data bss dec hex filename
> > 28680 1184 25 29889 74c1 net/ipv4/udp.o.new
> > 28756 1184 25 29965 750d net/ipv4/udp.o.old
[]
> Here I have :
>
> # size net/ipv4/udp.o.*
> text data bss dec hex filename
> 21989 616 9 22614 5856 net/ipv4/udp.o.old
> 21957 616 9 22582 5836 net/ipv4/udp.o.new
Curious. What gcc version?
with that 4.9.1 gcc version and a defconfig (x86-64) I get:
$ size net/ipv[46]/udp.o*
text data bss dec hex filename
21328 672 9 22009 55f9 net/ipv4/udp.o.new
21312 672 9 21993 55e9 net/ipv4/udp.o.old
14463 588 2 15053 3acd net/ipv6/udp.o.new
14527 588 2 15117 3b0d net/ipv6/udp.o.old
and defconfig x86-32:
$ size net/ipv[46]/udp.o*
text data bss dec hex filename
19626 324 5 19955 4df3 net/ipv4/udp.o.new
19706 324 5 20035 4e43 net/ipv4/udp.o.old
14189 300 2 14491 389b net/ipv6/udp.o.new
14125 300 2 14427 385b net/ipv6/udp.o.old
> With CONFIG_CC_OPTIMIZE_FOR_SIZE=y I even have an opposite result (code
> gets bigger after your patch)
>
> # size net/ipv4/udp.o.*
> text data bss dec hex filename
> 17242 600 9 17851 45bb net/ipv4/udp.o.old
> 17256 600 9 17865 45c9 net/ipv4/udp.o.new
>
> Anyway, your patch looks fine to me, no matter what the code size is.
>
> Acked-by: Eric Dumazet <edumazet@google.com>
next prev parent reply other threads:[~2014-12-02 5:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 1:39 [PATCH net-next] udp: Neaten and reduce size of compute_score functions Joe Perches
2014-12-02 2:59 ` Eric Dumazet
2014-12-02 3:09 ` Joe Perches
2014-12-02 4:29 ` [PATCH V2 " Joe Perches
2014-12-02 5:08 ` Eric Dumazet
2014-12-02 5:26 ` Joe Perches [this message]
2014-12-09 1:29 ` David Miller
2014-12-02 4:44 ` [PATCH " Eric Dumazet
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=1417497975.4894.16.camel@perches.com \
--to=joe@perches.com \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.