From: Arend van Spriel <arend@broadcom.com>
To: Denys Vlasenko <dvlasenk@redhat.com>,
Franky Lin <frankyl@broadcom.com>,
Hante Meuleman <meuleman@broadcom.com>,
"John W. Linville" <linville@tuxdriver.com>,
<linux-kernel@vger.kernel.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 1/4] brcm80211: deinline brcmf_chip_cr4_enterdl, save 440 bytes
Date: Mon, 31 Mar 2014 15:42:55 +0200 [thread overview]
Message-ID: <533970DF.70303@broadcom.com> (raw)
In-Reply-To: <53394F23.6080805@redhat.com>
On 31/03/14 13:18, Denys Vlasenko wrote:
> On 03/31/2014 09:38 AM, Arend van Spriel wrote:
>> On 30/03/14 23:31, Denys Vlasenko wrote:
>>> Automated script discovered that without forced inlining,
>>> gcc-4.7 generates smaller code for this function.
>>>
>>> There is no need to declare static functions inline anyway:
>>> nowadays gcc detects single-callsite static functions
>>> which benefit from inlining.
>>
>> These patches look awfully familiar. I tend to object, but I don't know the details of this automated script.
>
> The script removes "static" keyword, recompiles the .c file,
> compares the sizes, and if code size went down,
> creates a patch
>
>> How about execution time or is this only compile tested?
>
> The change adds one pair of call/return instructions -
> probably around 5-10 CPU cycles.
>
> The function in question is a part of firmware download logic,
> which is nowhere near being hot path/.
True. My remarks are on all four patches and I just replied to the first
patch. The other patches are in interrupt handling code, ie. interrupt
or bottom-halve context.
>> The other thing is that you seem to rely on a specific gcc version.
>> What about pre-4.7? How about different architectures.
>> Was this determined on x86, arm, sparc, mips.
>> All these questions make me say 'nay'.
>
> Not making functions inline unless there is a good reason
> is a general good coding practice. It is not a compiler-
> or architecture-specific optimization.
Agree, but you seem to assume that in this case there is no good reason.
Regards,
Arend
prev parent reply other threads:[~2014-03-31 13:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-30 21:31 [PATCH 1/4] brcm80211: deinline brcmf_chip_cr4_enterdl, save 440 bytes Denys Vlasenko
2014-03-30 21:31 ` [PATCH 2/4] brcm80211: deinline dma64_dd_upd, save 157 bytes Denys Vlasenko
2014-03-30 21:31 ` [PATCH 3/4] brcm80211: deinline wlc_intstatus, save 429 bytes Denys Vlasenko
2014-03-30 21:31 ` [PATCH 4/4] brcm80211: deinline brcmf_sdio_clrintr, save 8979 bytes Denys Vlasenko
2014-03-31 7:38 ` [PATCH 1/4] brcm80211: deinline brcmf_chip_cr4_enterdl, save 440 bytes Arend van Spriel
2014-03-31 11:18 ` Denys Vlasenko
2014-03-31 11:19 ` Denys Vlasenko
2014-03-31 13:42 ` Arend van Spriel [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=533970DF.70303@broadcom.com \
--to=arend@broadcom.com \
--cc=dvlasenk@redhat.com \
--cc=frankyl@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=meuleman@broadcom.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 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.