Thread (15 messages) 15 messages, 6 authors, 2022-02-18

Re: [PATCH net v3] net: Force inlining of checksum functions in net/checksum.h

From: Masahiro Yamada <masahiroy@kernel.org>
Date: 2022-02-17 16:22:03
Also in: lkml, netdev

On Fri, Feb 18, 2022 at 12:15 AM David Laight [off-list ref] wrote:
From: Christophe Leroy
quoted
Sent: 17 February 2022 14:55

Le 17/02/2022 à 15:50, Christophe Leroy a écrit :
quoted
Adding Ingo, Andrew and Nick as they were involved in the subjet,

Le 17/02/2022 à 14:36, David Laight a écrit :
quoted
From: Christophe Leroy
quoted
Sent: 17 February 2022 12:19

All functions defined as static inline in net/checksum.h are
meant to be inlined for performance reason.

But since commit ac7c3e4ff401 ("compiler: enable
CONFIG_OPTIMIZE_INLINING forcibly") the compiler is allowed to
uninline functions when it wants.

Fair enough in the general case, but for tiny performance critical
checksum helpers that's counter-productive.
There isn't a real justification for allowing the compiler
to 'not inline' functions in that commit.
Do you mean that the two following commits should be reverted:

- 889b3c1245de ("compiler: remove CONFIG_OPTIMIZE_INLINING entirely")
- 4c4e276f6491 ("net: Force inlining of checksum functions in
net/checksum.h")
Of course not the above one (copy/paste error), but:
- ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly")
That's the one I looked at.


No.  Not that one.

The commit you presumably want to revert is:

a771f2b82aa2 ("[PATCH] Add a section about inlining to
Documentation/CodingStyle")

This is now referred to as "__always_inline disease", though.




CONFIG_OPTIMIZE_INLINING has 14 years of history for x86.
See commit 60a3cdd06394 ("x86: add optimized inlining").
We always give gcc freedom to not inline functions marked as inline.




-- 
Best Regards
Masahiro Yamada
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help