[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53394F23.6080805@redhat.com>
Date: Mon, 31 Mar 2014 13:18:59 +0200
From: Denys Vlasenko <dvlasenk@...hat.com>
To: Arend van Spriel <arend@...adcom.com>,
Franky Lin <frankyl@...adcom.com>,
Hante Meuleman <meuleman@...adcom.com>,
"John W. Linville" <linville@...driver.com>,
linux-kernel@...r.kernel.org, linux-wireless@...r.kernel.org
Subject: Re: [PATCH 1/4] brcm80211: deinline brcmf_chip_cr4_enterdl, save
440 bytes
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/.
> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists