Re: [PATCH] powerpc: Force inlining of csum_add()

From: Christophe Leroy
Date: Wed May 12 2021 - 10:43:48 EST




Le 12/05/2021 à 16:31, Segher Boessenkool a écrit :
On Wed, May 12, 2021 at 02:56:56PM +0200, Christophe Leroy wrote:
Le 11/05/2021 à 12:51, Segher Boessenkool a écrit :
Something seems to have decided this asm is more expensive than it is.
That isn't always avoidable -- the compiler cannot look inside asms --
but it seems it could be improved here.

Do you have (or can make) a self-contained testcase?

I have not tried, and I fear it might be difficult, because on a kernel
build with dozens of calls to csum_add(), only ip6_tunnel.o exhibits such
an issue.

Yeah. Sometimes you can force some of the decisions, but that usually
requires knowing too many GCC internals :-/

And there is even one completely unused instance of csum_add().

That is strange, that should never happen.

It seems that several .o include unused versions of csum_add. After the
final link, one remains (in addition to the used one) in vmlinux.

But it is a static function, so it should not end up in any object file
where it isn't used.

Well .... did I dream ?

Now I only find one extra .o with unused csum_add() : That's net/ipv6/exthdrs.o
It matches the one found in vmlinux.

Are you interested in -fdump-tree-einline-all for that one as well ?

Christophe