[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8e60979b-31f3-4037-a1f6-5db7d3ec00d3@intel.com>
Date: Wed, 10 Apr 2024 14:49:52 +0200
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, Diogo Ivo <diogo.ivo@...mens.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <pabeni@...hat.com>,
<netdev@...r.kernel.org>, <jan.kiszka@...mens.com>
Subject: Re: [PATCH net-next] net: ethernet: Move eth_*_addr_base to global
symbols
From: Alexander Lobakin <aleksander.lobakin@...el.com>
Date: Wed, 10 Apr 2024 13:48:54 +0200
> From: Jakub Kicinski <kuba@...nel.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
Powered by blists - more mailing lists