Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp59532ybp; Thu, 3 Oct 2019 10:09:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvCqfaENPkwW77a9GKEis2L8Lgi+tr2ua8wGU/v+WiL1Xf7z4NDO5QyW7eiF6du+lhYUED X-Received: by 2002:a17:906:1310:: with SMTP id w16mr8502903ejb.73.1570122576048; Thu, 03 Oct 2019 10:09:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570122576; cv=none; d=google.com; s=arc-20160816; b=0DKcWDMnthx2K8C8VtUvn9Q6bYE/iO40utC5hthjXBXbmZoBpbLCdQ5x65TYtjqQ6t QnBeJf+DsYC3hzhD8jPqzUvj5LQE0JuIHntdpeo4CyXU9X61SmcnOZ24vO0DaR//1Mee ZequSupRsx5QeArBKpZ4Eo8lWPKsCz3dadieHgsC9oICkfQ2ypXm5tH28qeDDI/2XdnE 13qlwz9IOhwfU2F3omuw2O933lfRuPtvioNAbBzsO0iAcLbM5t1E2AtAiU/hOJXc43D3 UM+3wYWwdqbUmtkhRWbLUOoxn8uavHc3KuqiQakO2zLkOq09bpYxEK4iWc7Z9fjdAcyp DsTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Gqd652/dDPnOVpBjfjl/1byuIl8xF9urEvvAf1F0A24=; b=iF6w1ji9K0z0nTpjnad4eBUkEY83p68tGr4NAlwGYzJ5QvFu/CeefHH4Wr/HbLTN8U gVTQLDTVMrDIXGUabZUKDsEo+5HRdDC0fkWxqkukFKM2vrAED+omdZYKVO9hdURzJeW+ DcY2EF7V1p+kczwzWbYdyP6aLHxeSaKeWdvZMO25DJ8XisDTKhtLGiVRs/nWYyInwPjc axSX4f/JG1k/gRSNkz9HwhFH4SVvcr9w6e1HixyNWZlSqwQq92hukcpaleXrRUGHSQpQ qpvqmcTYuLm9R9rGdxr0mxppfI/mI4mh2c1tzzWG3DtXVC1hWcizTBuq1SlvSBMZ9Z13 E90w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w8bZ+hMV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6si1953567edb.235.2019.10.03.10.09.11; Thu, 03 Oct 2019 10:09:36 -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=@kernel.org header.s=default header.b=w8bZ+hMV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392693AbfJCRHq (ORCPT + 99 others); Thu, 3 Oct 2019 13:07:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:45456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404386AbfJCQgP (ORCPT ); Thu, 3 Oct 2019 12:36:15 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3C33F2070B; Thu, 3 Oct 2019 16:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570120574; bh=judodVvtfyPO1QPUMh5cBC0ImVnKv7kctqKG1EVeODU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=w8bZ+hMV38XC1vWA/KGyoQUuiE4RMwZVD9yuxNZqO981Z3pQMRsrpGiZPZo57qbw1 2NiUg7aTcpDliYgmtTHGHRnbLrGUeclrjXfMhOUoXSYlXrxMkyKovSCk2lBulZwJOw bNJJjmxrrIkGjj1w8uy8Xd6xBBr/QuxGzun0vLdI= Date: Thu, 3 Oct 2019 17:36:08 +0100 From: Will Deacon To: Linus Torvalds Cc: Geert Uytterhoeven , Nick Desaulniers , Russell King - ARM Linux admin , Masahiro Yamada , Nicolas Saenz Julienne , Andrew Morton , Ingo Molnar , Borislav Petkov , Miguel Ojeda , linux-arch , LKML , Catalin Marinas , Stefan Wahren , Kees Cook , Arnd Bergmann , clang-built-linux Subject: Re: [PATCH] compiler: enable CONFIG_OPTIMIZE_INLINING forcibly Message-ID: <20191003163606.iqzcxvghaw7hdqb5@willie-the-truck> References: <20191001092823.z4zhlbwvtwnlotwc@willie-the-truck> <20191001170142.x66orounxuln7zs3@willie-the-truck> <20191001175512.GK25745@shell.armlinux.org.uk> <20191001181438.GL25745@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? ...?) Will