Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1877717ybn; Thu, 26 Sep 2019 03:38:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDnCgqVbyefQWI3lZdL9IpIprSYt3Zpi0KNL91e43keneuIMseckvhzwGTW9qTo0Iuc8KW X-Received: by 2002:a17:906:48e:: with SMTP id f14mr2358513eja.15.1569494292186; Thu, 26 Sep 2019 03:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569494292; cv=none; d=google.com; s=arc-20160816; b=VY9yhq9z9b5+Xyge+DOPrNLbOcmW2bksJi3Hcsvnv6ir/bjvjT/1hgaAZUJpotKZbB EnNG4mUUf16LnnhRI5B9mZGwN3zDgtC184WPPp1ab/5TZZ+DHgEff0kKTRPcuKi5DlOk UpRKPHqtBkGtajkmJipwSwCElwlc9SeepH/P8WLL9JRYsqoyaFJcC5oqueNHLFtQEv+7 FmtD3zpmbf+hT7a4Ufs8D7FLME0ZeSmR1mGQXwA2rJkYG3NzyG62N8NB4efFYnv6IVKy 2VGffxPDj211REv8ELTFHn6qKiPp9F25XcmsJEY4vtgTpEj9xU17YvDRHiJwM9J0SLAa pIOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=4I6vObNO+Eec4OPIBIfi7DxQxYeb1r9KDS6T3ha1JhQ=; b=tLZ6yMEyTzf8vY2Hx0cATa50cIcaikgvoeUM59jOAWaSMyAJr5VgZhO/MRQFYLS6C3 k6OXW9eBpdd4HSWJqCTvFNcbCpL5RC4cmIIq7WEI/ezOKXsi8JiQVK/6aiOC0uqU9sN/ Sxwtik7Ha1+/1e0QKbl9RWFJ24K2iiR3roKgjKV28IWL9tLmriXKdCPrQf72BnBO0VU7 sGMiZxW87iCysn9lDv8GBwoboSd/0PPW4/SM1f++RJqMlhPyNd9Ppo2C898stwiJ6v95 LOmIx2UzDSaLI0bFQbgga0smac2tFIe7F7RgoFKxT8U5lP07RyHEvebv89NibMNcwjm8 FO+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QXaq+H8N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id by16si911588edb.30.2019.09.26.03.37.48; Thu, 26 Sep 2019 03:38:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QXaq+H8N; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729009AbfIZJrT (ORCPT + 99 others); Thu, 26 Sep 2019 05:47:19 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:46779 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727313AbfIZJrR (ORCPT ); Thu, 26 Sep 2019 05:47:17 -0400 Received: from mail-vk1-f171.google.com (mail-vk1-f171.google.com [209.85.221.171]) (authenticated) by conssluserg-01.nifty.com with ESMTP id x8Q9lBbA004362; Thu, 26 Sep 2019 18:47:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com x8Q9lBbA004362 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1569491232; bh=4I6vObNO+Eec4OPIBIfi7DxQxYeb1r9KDS6T3ha1JhQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QXaq+H8NdpNfz7HoyLS7jiEWMU4kRC+NDd1DuLdZ86FjIQnCPKmEJfOnUdy6zxYzc n9t/x7watAYCvu/nvrMfXobCOs2poNgZoHxJ7uogYSmPnJ6gtjamN1jwGu2uDar15y 5uqvx2tkLoZDsnsbJUIypvAK5AQiNRYxsWn486DxYIKjiWw8epcwhp+gnQMm+ezf4H 8vsA/LHfHTR5l71eFQVhtVlxtZQWZv4QXQCUdN20ccDcXKqoQm7AMwv9vavXsdvIGW hcbRzh0JogNYSscuJQSKnQIBly7aOAGusb5qdjqypQgi5r9zmGPEx3NH/XzI/+4Fkg 87HzqMkhCrcsQ== X-Nifty-SrcIP: [209.85.221.171] Received: by mail-vk1-f171.google.com with SMTP id s72so302059vkh.5; Thu, 26 Sep 2019 02:47:11 -0700 (PDT) X-Gm-Message-State: APjAAAUAakcCxdrHv72vSnkvbLdsK9on4TQ7JOkWFy211+TYWy3Z9Wrw AA+E4mQXxYC7xwxKrFRXy4hOLWMfVFvuI/3vH9w= X-Received: by 2002:ac5:cc63:: with SMTP id w3mr1147443vkm.34.1569491230937; Thu, 26 Sep 2019 02:47:10 -0700 (PDT) MIME-Version: 1.0 References: <20190830034304.24259-1-yamada.masahiro@socionext.com> In-Reply-To: From: Masahiro Yamada Date: Thu, 26 Sep 2019 18:46:34 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] compiler: enable CONFIG_OPTIMIZE_INLINING forcibly To: Geert Uytterhoeven Cc: Andrew Morton , Ingo Molnar , Borislav Petkov , Linus Torvalds , Nick Desaulniers , Miguel Ojeda , linux-arch , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On Thu, Sep 26, 2019 at 6:26 PM Geert Uytterhoeven wrote: > > Hi Yamada-san, > > On Thu, Sep 26, 2019 at 11:03 AM Masahiro Yamada > wrote: > > On Thu, Sep 26, 2019 at 5:54 PM Geert Uytterhoeven wrote: > > > On Fri, Aug 30, 2019 at 5:44 AM Masahiro Yamada > > > wrote: > > > > Commit 9012d011660e ("compiler: allow all arches to enable > > > > CONFIG_OPTIMIZE_INLINING") allowed all architectures to enable > > > > this option. A couple of build errors were reported by randconfig, > > > > but all of them have been ironed out. > > > > > > > > Towards the goal of removing CONFIG_OPTIMIZE_INLINING entirely > > > > (and it will simplify the 'inline' macro in compiler_types.h), > > > > this commit changes it to always-on option. Going forward, the > > > > compiler will always be allowed to not inline functions marked > > > > 'inline'. > > > > > > > > This is not a problem for x86 since it has been long used by > > > > arch/x86/configs/{x86_64,i386}_defconfig. > > > > > > > > I am keeping the config option just in case any problem crops up for > > > > other architectures. > > > > > > > > The code clean-up will be done after confirming this is solid. > > > > > > > > Signed-off-by: Masahiro Yamada > > > > > > This breaks compiling drivers/video/fbdev/c2p*, as the functions in > > > drivers/video/fbdev/c2p_core.h are no longer inlined, leading to calls > > > to the non-existent function c2p_unsupported(), as reported by KISSKB: > > > > > > On Thu, Sep 26, 2019 at 5:02 AM wrote: > > > > FAILED linux-next/m68k-defconfig/m68k Thu Sep 26, 12:58 > > > > > > > > http://kisskb.ellerman.id.au/kisskb/buildresult/13973194/ > > > > > > > > Commit: Add linux-next specific files for 20190925 > > > > d47175169c28eedd2cc2ab8c01f38764cb0269cc > > > > Compiler: m68k-linux-gcc (GCC) 4.6.3 / GNU ld (GNU Binutils) 2.22 > > > > > > > > Possible errors > > > > --------------- > > > > > > > > c2p_planar.c:(.text+0xd6): undefined reference to `c2p_unsupported' > > > > c2p_planar.c:(.text+0x1dc): undefined reference to `c2p_unsupported' > > > > c2p_iplan2.c:(.text+0xc4): undefined reference to `c2p_unsupported' > > > > c2p_iplan2.c:(.text+0x150): undefined reference to `c2p_unsupported' > > > > make[1]: *** [Makefile:1074: vmlinux] Error 1 > > > > make: *** [Makefile:179: sub-make] Error 2 > > > > > > I managed to reproduce this with gcc version 8.3.0 (Ubuntu > > > 8.3.0-6ubuntu1~18.04.1) , and bisected the failure to commit > > > 025f072e5823947c ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") . > > > > > > Marking the functions __always_inline instead of inline fixes that. > > > Shall I send a patch to do that? > > > > > > Yes, please. > > OK, will do. > > > But you do not need to touch _transp() or comp(). > > Only functions that call c2p_unsupported(). > > However, the inlining of these functions is very performance-sensitive too. > So perhaps I should mark all of them __always_inline? I want to leave as much compiler's freedom as possible, and the optimization criteria depends on CONFIG option. When CONFIG_CC_OPTIMIZE_FOR_SIZE is chosen, the optimization should respect the code size over performance, and the compiler may prefer not inlining it. So, the basic idea is, use __always_inline only when otherwise the builds would be broken. Masahiro Yamada > > BTW, c2p_unsupported() can be replaced with BUILD_BUG(). > > This will break the build earlier in case > > it cannot be optimized out. > > Right. Will do, too. > > Thanks! > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds -- Best Regards Masahiro Yamada