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.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,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 989E3C4363A for ; Wed, 21 Oct 2020 18:40:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AF2B21531 for ; Wed, 21 Oct 2020 18:40:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2411304AbgJUSke (ORCPT ); Wed, 21 Oct 2020 14:40:34 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:54712 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2411295AbgJUSkd (ORCPT ); Wed, 21 Oct 2020 14:40:33 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4CGfSb6Lsyz9vBLG; Wed, 21 Oct 2020 20:40:31 +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 iR_JaH-_rsVa; Wed, 21 Oct 2020 20:40:31 +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 4CGfSb4Rfmz9vBL6; Wed, 21 Oct 2020 20:40:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9EAA08B7FB; Wed, 21 Oct 2020 20:40:31 +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 QqsurjxGnjlv; Wed, 21 Oct 2020 20:40:31 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4F8AB8B7EA; Wed, 21 Oct 2020 20:40:31 +0200 (CEST) Subject: Re: ilog2 vs. GCC inlining heuristics To: Peter Zijlstra , Jakub Jelinek Cc: linux-toolchains@vger.kernel.org References: <20201021132718.GB2176@tucnak> <20201021151947.GL2628@hirez.programming.kicks-ass.net> From: Christophe Leroy Message-ID: <21556974-eea1-ed6a-ea6f-3e97a6eea4bc@csgroup.eu> Date: Wed, 21 Oct 2020 20:40:19 +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: <20201021151947.GL2628@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-toolchains@vger.kernel.org Le 21/10/2020 à 17:19, Peter Zijlstra a écrit : > On Wed, Oct 21, 2020 at 03:27:18PM +0200, Jakub Jelinek wrote: >> Hi! >> >> Based on the GCC PR97445 discussions, I'd like to propose following change, >> which should significantly decrease the amount of code in inline functions >> that use ilog2, but as I'm already two decades out of the Linux kernel >> development, I'd appreciate if some kernel developer could try that (all >> I have done is check that it gives the same results as before) and if it >> works submit it for inclusion into the kernel? > > I'll stick it in my queue and feed it to the robots. > I did a mpc885_ads_defconfig build with your patch. That's far better, even better than with gcc 9 without the patch. I only have two instances of get_order() in vmlinux, one of it is used twice, the other is never user. With -Winline, the reason for not inlining is for both because "the call is unlikely and the code size would grow" Christophe