Received: by 10.213.65.68 with SMTP id h4csp1618144imn; Thu, 5 Apr 2018 00:21:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx4882cRyLdbSgaP2zLxp06YPz1hColdEdUlQLBQ80h4c33pxOUS85MgAJKu8tdSqLTty9OT+ X-Received: by 10.98.65.220 with SMTP id g89mr16131751pfd.97.1522912911426; Thu, 05 Apr 2018 00:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522912911; cv=none; d=google.com; s=arc-20160816; b=VAUaU/bq7TmEsdXQIMhVLTe5DJJacqOk6z9clpqPCBQtkgdWvnoBzC+YvIfJmB0NvX 4Q6MjTkeEx44ldBIvryOA85nzU5mQvitOlubYM4MulRzYeFM1CNgie3xMMwGze29nVks Ssb2n6tHQXeqBe7Nh8iQdxwdMf21Ru2cb48k9N01YiueKzRelnlh5LWCE3xtNuxskuTA tBYjLHefcz3UlFfW62zN34maliu2TGP60Lvy4WqMvHeCto1mTZacmgJdjSp30naSKXa6 AVXu41j09uAD+PoaJtUsocaPew9jqX1bJpPxu0gazeFvmB74e3Qy5GYzaXO0lTDdp5pd LFIw== 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:arc-authentication-results; bh=DzuIxCPNeV8Au6y2zS/c8o2zsgSBW9CfqWO9ewR2Dp8=; b=A9X2BL1z0+EWzKw+kN04wIU8cB4aoJ7yGGmIAl9tES5NDe0tn27Mufn6KaC1Pu3iJ/ AwF1pWoydTDQFzbBj3v6hKoKVwXzIVSRYH+OrdC06QVz5297yhlBfRUdeb/L89yEahJk /YQRqUsnX+pGi9f8VWaCobEF2KhlrkxxVIiNqLzWiCirox/9oYesHs0NQ2WlpicTYtga 6hm+pdyPlQ+uE69Vm0UWeG5X76FhrlvVSwm1bktniAdHuuOXmPavpgfVm9INQWNyvX3Z FPuYECkq6tyhmPvUXYE04r4DUFasXZhkV/lrkLiqSIaGTOIkORFErB9bInFhnucc8wVA rpww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jqqwn1Uz; 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 n11-v6si7561867plg.236.2018.04.05.00.21.37; Thu, 05 Apr 2018 00:21:51 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jqqwn1Uz; 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 S1751406AbeDEHUZ (ORCPT + 99 others); Thu, 5 Apr 2018 03:20:25 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:56192 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbeDEHUX (ORCPT ); Thu, 5 Apr 2018 03:20:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=DzuIxCPNeV8Au6y2zS/c8o2zsgSBW9CfqWO9ewR2Dp8=; b=jqqwn1UzigLAk9ymYgRMqaVmn XMxoRqHV23lyNQ40xQSgJ4Ggb193hP8WbSEzlgFSF6pY7BgfCo/8hHEBgqBiPRwThrwRLUyNsXr/B GU7lOmasngAiBT6B5fZQ4QsHXt4IReN3d+iKF9MtsYaggaydNSLOLutB8jYe0r9w96wtTCR9Gn29z FZ5rPSq5Tg6HrWnPpDos2lrtcgS17arJ9fvREXtYVEI8P41d9p+eCKhJlCO2yjHtFDbNwyUJAXNeM 5mBQNtTCUzwDfuHhiUgDAzxMJl4QDkJifqgdgP9ZF6C/NWN3hv8B5mOUZ7vR++NbzQV8qJ+0pB8kf YUFZCI3EA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f3zBz-0001zI-B9; Thu, 05 Apr 2018 07:20:19 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A88FC2029F86F; Thu, 5 Apr 2018 09:20:17 +0200 (CEST) Date: Thu, 5 Apr 2018 09:20:17 +0200 From: Peter Zijlstra To: Matthias Kaehlcke Cc: Linus Torvalds , Arnd Bergmann , Ingo Molnar , Linux Kernel Mailing List , Thomas Gleixner , Andrew Morton , James Y Knight , Chandler Carruth , Stephen Hines , Nick Desaulniers , Kees Cook , Guenter Roeck , Greg Hackmann , Greg Kroah-Hartman Subject: Re: [GIT PULL] x86/build changes for v4.17 Message-ID: <20180405072017.GN4043@hirez.programming.kicks-ass.net> References: <20180404093007.GI4082@hirez.programming.kicks-ass.net> <20180404191724.GF87376@google.com> <20180404205848.GG87376@google.com> <20180404214639.GH87376@google.com> <20180404221744.GI87376@google.com> <20180404233111.GJ87376@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180404233111.GJ87376@google.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 04, 2018 at 04:31:11PM -0700, Matthias Kaehlcke wrote: > From some experiments it looks like clang, in difference to gcc, does > not treat constant values passed as parameters to inline function as > constants. Then you're also missing a heap of optimizations in code like rb_erase_augmented() which is specifically constructed to take advantage of constant propagation like that. Other sites where we expect that to happen is __mutex_lock_common(), __update_load_sum() and a bunch of others. There isn't strictly a bug here, but not doing that constant propagation will still result in shit code gen.