From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux admin Subject: Re: [PATCH] compiler: enable CONFIG_OPTIMIZE_INLINING forcibly Date: Sat, 12 Oct 2019 15:45:50 +0100 Message-ID: <20191012144550.GN25745@shell.armlinux.org.uk> References: <20191001170142.x66orounxuln7zs3@willie-the-truck> <20191001175512.GK25745@shell.armlinux.org.uk> <20191001181438.GL25745@shell.armlinux.org.uk> <20191003163606.iqzcxvghaw7hdqb5@willie-the-truck> <35643c7e-94e9-e410-543b-a7de17b59a32@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <35643c7e-94e9-e410-543b-a7de17b59a32@gmx.net> Sender: linux-kernel-owner@vger.kernel.org To: Stefan Wahren Cc: Will Deacon , Linus Torvalds , Geert Uytterhoeven , Nick Desaulniers , Masahiro Yamada , Nicolas Saenz Julienne , Andrew Morton , Ingo Molnar , Borislav Petkov , Miguel Ojeda , linux-arch , LKML , Catalin Marinas , Kees Cook , Arnd Bergmann , clang-built-linux List-Id: linux-arch.vger.kernel.org On Sat, Oct 12, 2019 at 12:15:42PM +0200, Stefan Wahren wrote: > Hi, > > Am 03.10.19 um 18:36 schrieb Will Deacon: > > On Wed, Oct 02, 2019 at 01:39:40PM -0700, Linus Torvalds wrote: > >> On Wed, Oct 2, 2019 at 5:56 AM Geert Uytterhoeven wrote: > >>>> Then use the C preprocessor to force the inlining. I'm sorry it's not > >>>> as pretty as static inline functions. > >>> Which makes us lose the baby^H^H^H^Htype checking performed > >>> on function parameters, requiring to add more ugly checks. > >> I'm 100% agreed on this. > >> > >> If the inline change is being pushed by people who say "you should > >> have used macros instead if you wanted inlining", then I will just > >> revert that stupid commit that is causing problems. > >> > >> No, the preprocessor is not the answer. > >> > >> That said, code that relies on inlining for _correctness_ should use > >> "__always_inline" and possibly even have a comment about why. > >> > >> But I am considering just undoing commit 9012d011660e ("compiler: > >> allow all arches to enable CONFIG_OPTIMIZE_INLINING") entirely. The > >> advantages are questionable, and when the advantages are balanced > >> against actual regressions and the arguments are "use macros", that > >> just shows how badly thought out this was. > > It's clear that opinions are divided on this issue, but you can add > > an enthusiastic: > > > > Acked-by: Will Deacon > > > > if you go ahead with the revert. I'm all for allowing the compiler to > > make its own inlining decisions, but not when the potential for > > miscompilation isn't fully understood and the proposed alternatives turn > > the source into an unreadable mess. Perhaps we can do something different > > for 5.5 (arch opt-in? clang only? invert the logic? work to move functions > > over to __always_inline /before/ flipping the CONFIG option? ...?) > > what's the status on this? > > In need to prepare my pull requests for 5.5 and all recent kernelci > targets (including linux-next) with bcm2835_defconfig are still broken. I merged the patches late on Thursday, it may have been too late for linux-next to pick them up - and because of the time difference between UK and Australia, it means they won't be in linux-next until next week (basically, tomorrow). linux-next is basically a Sunday to Thursday operation from my point of view. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from pandora.armlinux.org.uk ([78.32.30.218]:49620 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727265AbfJLOqS (ORCPT ); Sat, 12 Oct 2019 10:46:18 -0400 Date: Sat, 12 Oct 2019 15:45:50 +0100 From: Russell King - ARM Linux admin Subject: Re: [PATCH] compiler: enable CONFIG_OPTIMIZE_INLINING forcibly Message-ID: <20191012144550.GN25745@shell.armlinux.org.uk> References: <20191001170142.x66orounxuln7zs3@willie-the-truck> <20191001175512.GK25745@shell.armlinux.org.uk> <20191001181438.GL25745@shell.armlinux.org.uk> <20191003163606.iqzcxvghaw7hdqb5@willie-the-truck> <35643c7e-94e9-e410-543b-a7de17b59a32@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35643c7e-94e9-e410-543b-a7de17b59a32@gmx.net> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Stefan Wahren Cc: Will Deacon , Linus Torvalds , Geert Uytterhoeven , Nick Desaulniers , Masahiro Yamada , Nicolas Saenz Julienne , Andrew Morton , Ingo Molnar , Borislav Petkov , Miguel Ojeda , linux-arch , LKML , Catalin Marinas , Kees Cook , Arnd Bergmann , clang-built-linux Message-ID: <20191012144550.Uqr62aoZK_TbjcXE1D7XF-q3sbvYVKp9O2Oe0RnLORA@z> On Sat, Oct 12, 2019 at 12:15:42PM +0200, Stefan Wahren wrote: > Hi, > > Am 03.10.19 um 18:36 schrieb Will Deacon: > > On Wed, Oct 02, 2019 at 01:39:40PM -0700, Linus Torvalds wrote: > >> On Wed, Oct 2, 2019 at 5:56 AM Geert Uytterhoeven wrote: > >>>> Then use the C preprocessor to force the inlining. I'm sorry it's not > >>>> as pretty as static inline functions. > >>> Which makes us lose the baby^H^H^H^Htype checking performed > >>> on function parameters, requiring to add more ugly checks. > >> I'm 100% agreed on this. > >> > >> If the inline change is being pushed by people who say "you should > >> have used macros instead if you wanted inlining", then I will just > >> revert that stupid commit that is causing problems. > >> > >> No, the preprocessor is not the answer. > >> > >> That said, code that relies on inlining for _correctness_ should use > >> "__always_inline" and possibly even have a comment about why. > >> > >> But I am considering just undoing commit 9012d011660e ("compiler: > >> allow all arches to enable CONFIG_OPTIMIZE_INLINING") entirely. The > >> advantages are questionable, and when the advantages are balanced > >> against actual regressions and the arguments are "use macros", that > >> just shows how badly thought out this was. > > It's clear that opinions are divided on this issue, but you can add > > an enthusiastic: > > > > Acked-by: Will Deacon > > > > if you go ahead with the revert. I'm all for allowing the compiler to > > make its own inlining decisions, but not when the potential for > > miscompilation isn't fully understood and the proposed alternatives turn > > the source into an unreadable mess. Perhaps we can do something different > > for 5.5 (arch opt-in? clang only? invert the logic? work to move functions > > over to __always_inline /before/ flipping the CONFIG option? ...?) > > what's the status on this? > > In need to prepare my pull requests for 5.5 and all recent kernelci > targets (including linux-next) with bcm2835_defconfig are still broken. I merged the patches late on Thursday, it may have been too late for linux-next to pick them up - and because of the time difference between UK and Australia, it means they won't be in linux-next until next week (basically, tomorrow). linux-next is basically a Sunday to Thursday operation from my point of view. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up