Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2935047img; Sun, 24 Mar 2019 23:43:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGlJkoNdBoDGrUgh8+ugZHhi45h2XCbJUpSo2z6PHyEmvWRmc/tU/6PEs/sQzDQ2XBPCmp X-Received: by 2002:aa7:8609:: with SMTP id p9mr22460003pfn.166.1553496193313; Sun, 24 Mar 2019 23:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553496193; cv=none; d=google.com; s=arc-20160816; b=S9rumk5YMIL/aESHzUGN55PNDxDR8Az4F296fMBXOlsQKezps3qNGIAL0OYF6/t5UU K783jDnht5pu6UXpy+Mxbv1FBVGMPqxxDckXcqY2awszek+jB9C+XCURsMOWhrNhakcc QNBANH1qeWBLatpMWApYIlTbxqPaV9o7Ik4EWIbarg7YpC/+S+YgvRf0Ken3nk3O0Hvr FHsb5STlZRkv+0mB7JPqHW2+7geLEBbT7LF3DTUDlvgOByw12QxshuPUPa02RW4k7ocj 8heDVfHN4xDYuBWSshZdMjEg/+X9p4V2kLmiAxtLwwzaqMWcgXdBhSwyyJO/INg7Sk2/ wUzQ== 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=LgQdWuJL8bNmI1YWcIHsJUQQGbgjm968J3Ixazu7mco=; b=Qoex1cDzf/Mihwhv7V99p+EpNtkeCcy32RRKUrZBQOOC7yIuuR7Mu+6VXH/snhO9lM aA1Da/mKT1RwBunievvU4OgDqc7zEj35ZpsYa9K/mAn0p/YfJ1uCUs9wFDiEeB5Y11vi Y8d8XhBmJ21NMSde1UkZDRj12la6zpUrWexCuWQxyIcH285FO9/8t/kQl0NGRcnJUHMy k10S+hbYIyvUAHK9f0s9wE/S68bs7hB4EcinSgQq8HHjC1JjaX+boLmM4GfeqDCiF+vW GCyGEnVfi6KxMeEW8pHPq3E5hbI3VVN0hcKLz9dSRWfwKr420hqfNRt4RYmL9Mmxh/HS QypQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=B5BHmYRn; 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 y66si13131502pgy.34.2019.03.24.23.42.58; Sun, 24 Mar 2019 23:43:13 -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=B5BHmYRn; 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 S1729720AbfCYGmY (ORCPT + 99 others); Mon, 25 Mar 2019 02:42:24 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:58369 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729631AbfCYGmY (ORCPT ); Mon, 25 Mar 2019 02:42:24 -0400 Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) (authenticated) by conssluserg-05.nifty.com with ESMTP id x2P6gH3B016514; Mon, 25 Mar 2019 15:42:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com x2P6gH3B016514 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553496138; bh=LgQdWuJL8bNmI1YWcIHsJUQQGbgjm968J3Ixazu7mco=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=B5BHmYRn07ugANaqhyD5xO4JbB9Xbz4/RyPosjdApvptYCTdEHZJwF4S/cef5s3XL xgr8JBi3F9QqIHdtJhkDHV0z2ik2eS34K8r222LAa4L/PtKmua1/9+L9UcyHa15gEQ 6troHDwfJJTRiGa1fvlcjYN8vUOLXMNKJnanzZqOvs3D5IEbf21ZetR2KbePZGg7Vy TGuZ3a2dWHy0yJS3E28btdsw7vDYtaA4a1fhUfSmr6wO/ZzS+1yqeaGTTL6AssOukR S9yWqFekaN0j2MMugIJLNVROpX/aiU2iaZRc/QLBJTo0AHLiKWAuZBU6YLJSPc3xGb j/OxosQ7PJ0ug== X-Nifty-SrcIP: [209.85.217.45] Received: by mail-vs1-f45.google.com with SMTP id i207so4713344vsd.10; Sun, 24 Mar 2019 23:42:17 -0700 (PDT) X-Gm-Message-State: APjAAAWWcuGH57Ad+/aimQZotiAU92yPWPPKtVUoBsU2ySyVFnTO4DsE AuoCgmAN9Qnhychr9E9EHWgJPUGTlwH08Apjd9g= X-Received: by 2002:a67:74cd:: with SMTP id p196mr13915498vsc.215.1553496136642; Sun, 24 Mar 2019 23:42:16 -0700 (PDT) MIME-Version: 1.0 References: <1553062828-27798-1-git-send-email-yamada.masahiro@socionext.com> <20190321080133.GB3916@osiris> In-Reply-To: <20190321080133.GB3916@osiris> From: Masahiro Yamada Date: Mon, 25 Mar 2019 15:41:40 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING To: Heiko Carstens Cc: linux-arch , linux-s390 , Dave Hansen , Arnd Bergmann , Michael Ellerman , X86 ML , linux-mips@vger.kernel.org, Linux Kernel Mailing List , Paul Burton , Ingo Molnar , linux-mtd , Andrew Morton , linuxppc-dev , linux-arm-kernel 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 Heiko, On Thu, Mar 21, 2019 at 5:02 PM Heiko Carstens wrote: > > On Wed, Mar 20, 2019 at 03:20:27PM +0900, Masahiro Yamada wrote: > > Commit 60a3cdd06394 ("x86: add optimized inlining") introduced > > CONFIG_OPTIMIZE_INLINING, but it has been available only for x86. > > > > The idea is obviously arch-agnostic although we need some code fixups. > > This commit moves the config entry from arch/x86/Kconfig.debug to > > lib/Kconfig.debug so that all architectures (except MIPS for now) can > > benefit from it. > > > > At this moment, I added "depends on !MIPS" because fixing 0day bot reports > > for MIPS was complex to me. > > > > I tested this patch on my arm/arm64 boards. > > > > This can make a huge difference in kernel image size especially when > > CONFIG_OPTIMIZE_FOR_SIZE is enabled. > > > > For example, I got 3.5% smaller arm64 kernel image for v5.1-rc1. > > > > dec file > > 18983424 arch/arm64/boot/Image.before > > 18321920 arch/arm64/boot/Image.after > > Well, this will change, since now people (have to) start adding > __always_inline annotations on all architectures, most likely until > all have about the same amount of annotations like x86. This will > reduce the benefit. If people start to replace inline with __always_inline here and there, yes, the difference will be reduced. Perhaps, we might end up with fixing dozens of places or so, but I guess we would still get benefit. > Not sure if it's really a win that we get the inline vs > __always_inline discussion now on all architectures. This feature is not x86-specific. I prefer "do it for all arches or don't do it at all" instead of the half-baked state. If we force inlining for the 'inline' marker there is no point of having __always_inline. -- Best Regards Masahiro Yamada