netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Jakub Kicinski <kuba@kernel.org>, Diogo Ivo <diogo.ivo@siemens.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <jan.kiszka@siemens.com>
Subject: Re: [PATCH net-next] net: ethernet: Move eth_*_addr_base to global symbols
Date: Wed, 10 Apr 2024 14:49:52 +0200	[thread overview]
Message-ID: <8e60979b-31f3-4037-a1f6-5db7d3ec00d3@intel.com> (raw)
In-Reply-To: <e6166f35-87d4-4873-a412-fcf62d22e482@intel.com>

From: Alexander Lobakin <aleksander.lobakin@intel.com>
Date: Wed, 10 Apr 2024 13:48:54 +0200

> From: Jakub Kicinski <kuba@kernel.org>
> Date: Tue, 9 Apr 2024 14:58:35 -0700
> 
>> On Tue,  9 Apr 2024 17:07:18 +0100 Diogo Ivo wrote:
>>> Promote IPv4/6 and Ethernet reserved base addresses to global symbols
>>> to avoid local copies being created when these addresses are referenced.
>>
>> Did someone bloat-o-meter this?
> 
> bloat-o-meter would be good, right.
> 
>> I agree it's odd but the values are tiny and I'd expect compiler 
>> to eliminate the dead instances.
> 
> The compiler won't copy the arrays to each file which includes
> ethernet.h obviously.
> 
>> I mean, the instances are literally smaller than a pointer we'll
>> need to refer to them, if they can be inlined..
> 
> The compilers are sometimes even able to inline extern consts. So,
> without bloat-o-meter, I wouldn't assume anything at all :)

Kuba is right, converting them to globals only hurts.

vmlinux before/after the patch:

text: add/remove: 0/0 grow/shrink: 2/0 up/down: 16/0 (16)
text: add/remove: 3/0 grow/shrink: 0/0 up/down: 18/0 (18)

Simple module which uses static inlines referencing these arrays:

text: add/remove: 0/0 grow/shrink: 4/0 up/down: 75/0 (75)

I'm sorry that I suggested this anti-improvement :z
Please reject this patch.

Thanks,
Olek

      reply	other threads:[~2024-04-10 12:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 16:07 [PATCH net-next] net: ethernet: Move eth_*_addr_base to global symbols Diogo Ivo
2024-04-09 21:58 ` Jakub Kicinski
2024-04-10 11:48   ` Alexander Lobakin
2024-04-10 12:49     ` Alexander Lobakin [this message]

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=8e60979b-31f3-4037-a1f6-5db7d3ec00d3@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=davem@davemloft.net \
    --cc=diogo.ivo@siemens.com \
    --cc=edumazet@google.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).