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,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 CCCC0C433E7 for ; Mon, 19 Oct 2020 08:56:59 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 68F1520790 for ; Mon, 19 Oct 2020 08:56:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68F1520790 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CF9c74JV7zDqZq for ; Mon, 19 Oct 2020 19:56:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=csgroup.eu (client-ip=93.17.236.30; helo=pegase1.c-s.fr; envelope-from=christophe.leroy@csgroup.eu; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=csgroup.eu Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CF9Yz2B9VzDqYh for ; Mon, 19 Oct 2020 19:54:55 +1100 (AEDT) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4CF9Yf5vBYz9v07J; Mon, 19 Oct 2020 10:54:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id fbqZzeGnX00j; Mon, 19 Oct 2020 10:54:46 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4CF9Yf4fxFz9v07C; Mon, 19 Oct 2020 10:54:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A4EF68B75E; Mon, 19 Oct 2020 10:54:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id ACvILMQBGHbJ; Mon, 19 Oct 2020 10:54:51 +0200 (CEST) Received: from [10.25.210.27] (po15451.idsi0.si.c-s.fr [10.25.210.27]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6D3578B797; Mon, 19 Oct 2020 10:54:51 +0200 (CEST) Subject: Re: [PATCH] asm-generic: Force inlining of get_order() to work around gcc10 poor decision To: Segher Boessenkool References: <96c6172d619c51acc5c1c4884b80785c59af4102.1602949927.git.christophe.leroy@csgroup.eu> <0bd0afae-f043-2811-944b-c94d90e231d2@csgroup.eu> <20201019083225.GN2672@gate.crashing.org> From: Christophe Leroy Message-ID: <188e00e1-ae41-693e-1d05-f8d87e7ee696@csgroup.eu> Date: Mon, 19 Oct 2020 10:54:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20201019083225.GN2672@gate.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Arnd Bergmann , Linux Kernel Mailing List , Masahiro Yamada , Joel Stanley , Andrew Morton , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Le 19/10/2020 à 10:32, Segher Boessenkool a écrit : > On Mon, Oct 19, 2020 at 07:50:41AM +0200, Christophe Leroy wrote: >> Le 19/10/2020 à 06:55, Joel Stanley a écrit : >>>> In the old days, marking a function 'static inline' was forcing >>>> GCC to inline, but since commit ac7c3e4ff401 ("compiler: enable >>>> CONFIG_OPTIMIZE_INLINING forcibly") GCC may decide to not inline >>>> a function. >>>> >>>> It looks like GCC 10 is taking poor decisions on this. > >>> 1952 bytes smaller with your patch applied. Did you raise this with >>> anyone from GCC? >> >> Yes I did, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97445 >> >> For the time being, it's at a standstill. > > The kernel should just use __always_inline if that is what it *wants*; > that is true here most likely. GCC could perhaps improve its heuristics > so that it no longer thinks these functions are often too big for > inlining (they *are* pretty big, but not after basic optimisations with > constant integer arguments). > Yes I guess __always_inline is to be added on functions like this defined in headers for exactly that, and that's the purpose of this patch. However I find it odd that get_order() is outlined by GCC even in some object files that don't use it at all, for instance in fs/pipe.o Christophe