From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 295D4C43460 for ; Wed, 12 May 2021 20:12:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBB07613FB for ; Wed, 12 May 2021 20:12:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380350AbhELUBH (ORCPT ); Wed, 12 May 2021 16:01:07 -0400 Received: from gate.crashing.org ([63.228.1.57]:41948 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355206AbhELS1n (ORCPT ); Wed, 12 May 2021 14:27:43 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 14CIL4bD009429; Wed, 12 May 2021 13:21:04 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 14CIL4PD009428; Wed, 12 May 2021 13:21:04 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 12 May 2021 13:21:03 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc: Force inlining of csum_add() Message-ID: <20210512182103.GX10366@gate.crashing.org> References: <20210511105154.GJ10366@gate.crashing.org> <20210512143105.GW10366@gate.crashing.org> <2623fe98-7a73-f7a2-bcba-2d668d00ffd0@csgroup.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2623fe98-7a73-f7a2-bcba-2d668d00ffd0@csgroup.eu> User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 12, 2021 at 04:43:33PM +0200, Christophe Leroy wrote: > 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 ? Sure. Hopefully it will show more :-) Segher