Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp368543pxu; Tue, 6 Oct 2020 08:18:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJl8rEgQw1C7hLBv9WnLdmBjA/0s+YXYIdrC82e4yCHKm7VMhbg/cBeujCel54/nVxx7Y7 X-Received: by 2002:a17:906:f11a:: with SMTP id gv26mr5643145ejb.13.1601997499237; Tue, 06 Oct 2020 08:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601997499; cv=none; d=google.com; s=arc-20160816; b=v+eDb4lT/xiRLemt1lh/q+AmPB7ViCNsNXmAGJRkgWeYx9sD2liut2sypIn+/1M3/U H5/qrK3baRWsW1CKuTMKg8yvoCoSfvKyRnLujm62DLym8Q+45RgXMP1Mo8rIgMN1B2k2 NmoqOpnO3B4zZ1KT2OOSdlH68ZHKkAb3X86koQfsAQNDpcmZ1rOK/0Y9ucCB46I2Y/Aq 1NRbLpiw2rXo5XrvKyjfP/D5qv2VH2kfYE3TRS4OtikdS/BcmX+SEUcYBo4NaxqoXoFR fyEMA7uE+X3GPaOLtq7QLl/XvT0gynoyB/e8+1kOi4m7ZWBYnpv2ibXnWHzBj2u6qyPx CXFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject :organization:autocrypt:from:references:cc:to:dkim-signature; bh=Go8SebkEveyTP4zXvp2mKBYrYYLG4tamiqhtc2Tw6MI=; b=hoU5keqbnNONQbqlkR5EC/pjlHEqypvOqnbiaR8DKV6xsHG2XVQATuvXG/oorIQQpj 3JcpIMqMA+/RImlNS6u4n0HjdPI3l5uYjcs/Z4k4ZbwElV3V/Q/2R4+EegSP8/2bXrxN 8+O8yYlUXpotmHKQbJw/ipr6LxfIclD//jGsrflkTOcP0ibNxrH1+paidPBi/U4J+Qmn 4XooCC5X0TvRE0azogOMpETZyQTt+hz7fLmQw1lVBubet/kXhELT3FBpE6Kc41+Kxjf5 eO+SOf/39Vr51mcJySFvTPBT/BNhxdgLbzjnQr480clgWwGBVAabfM9aEmYyD+vEerAj Kkcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="HbJCJRZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y26si2113738edv.590.2020.10.06.08.17.56; Tue, 06 Oct 2020 08:18:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="HbJCJRZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726060AbgJFPQi (ORCPT + 99 others); Tue, 6 Oct 2020 11:16:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34548 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbgJFPQi (ORCPT ); Tue, 6 Oct 2020 11:16:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601997396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Go8SebkEveyTP4zXvp2mKBYrYYLG4tamiqhtc2Tw6MI=; b=HbJCJRZ/9t6mxUCQSw3PTPOmMgoYy6l8/DxZzleTQfKzdMWMnYBW+RsxHNTNgWLhOVHqSn TV8sorARw2GHpFoSFrSYv4+n6/6bBYJV+ORjjgpNQj0os6ejRbUgWOWN9FFsKSwlqBJnD4 MZYdlCIk9/MMbKlAjzPemEXoub36BvE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-AgBTXNsJPIybgDXUy_0H4g-1; Tue, 06 Oct 2020 11:16:33 -0400 X-MC-Unique: AgBTXNsJPIybgDXUy_0H4g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D48B18A8225; Tue, 6 Oct 2020 15:16:31 +0000 (UTC) Received: from [10.36.113.231] (ovpn-113-231.ams2.redhat.com [10.36.113.231]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A5D25D9CD; Tue, 6 Oct 2020 15:16:27 +0000 (UTC) To: Peter Zijlstra , "stern@rowland.harvard.edu" Cc: David Laight , "linux-toolchains@vger.kernel.org" , Will Deacon , Paul McKenney , "linux-kernel@vger.kernel.org" , "parri.andrea@gmail.com" , "boqun.feng@gmail.com" , "npiggin@gmail.com" , "dhowells@redhat.com" , "j.alglave@ucl.ac.uk" , "luc.maranget@inria.fr" , "akiyks@gmail.com" , "dlustig@nvidia.com" , "joel@joelfernandes.org" , "torvalds@linux-foundation.org" References: <20201006114710.GQ2628@hirez.programming.kicks-ass.net> <3dfe7daed3c44f46a6989b6513ad7bb0@AcuMS.aculab.com> <20201006133115.GT2628@hirez.programming.kicks-ass.net> <20201006142324.GB416765@rowland.harvard.edu> <20201006144302.GY2628@hirez.programming.kicks-ass.net> From: Nick Clifton Autocrypt: addr=nickc@redhat.com; prefer-encrypt=mutual; keydata= mQINBFm/2cUBEADkvRqMWfAryJ52T4J/640Av5cam9ojdFih9MjcX7QWFxIzJfTFYq2z+nb4 omdfZosdCJL2zGcn6C0AxpHNvxR9HMDkEyFHKrjDh4xWU+pH4z9azQEqJh331X7UzbZldqQo 16VkuVavgsTJaHcXm+nGIBTcUbl2oiTtHhmuaYxx6JTMcFjC7vyO5mLBw78wt52HBYweJ0Nj HBvvH/JxbAAULSPRUC61K0exlO49VFbFETQNG1hZTKEji95fPbre7PpXQ0ewQShUgttEE/J3 UA4jYaF9lOcZgUzbA27xTV//KomP0D30yr4e4EJEJYYNKa3hofTEHDXeeNgM25tprhBUMdbV RZpf2Keuk2uDVwc+EiOVri48rb1NU+60sOXvoGO6Ks81+mhAGmrBrlgLhAp8K1HPHI4MG4gH nrMqX2rEGUGRPFjC3qqVVlPm8H05PnosNqDLQ1Pf7C0pVgsCx6hKQB7Y1qBui7aoj9zeFaQg pYef+CEERIKEcWwrjaOJwK3pi9HFdxS0NNWYZj8HPzz/AsgTTQdsbulPlVq2SsctmOnL42CZ OCTppGYwl53CG/EqVY+UQBzFzJBaY8TJRFFYVEy5/HH4H11rMoZwqIkk71EOGU3X6mWlANRi kR3M4GhVITRzuaV69Fed+OeXcCmP94ASLfuhBR2uynmcHpBKpwARAQABtDtOaWNrIENsaWZ0 b24gKENoaWVmIEJpbnV0aWxzIE1haW50YWluZXIpIDxuaWNrY0ByZWRoYXQuY29tPokCOAQT AQIAIgUCWb/ZxQIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQE/zvid2ePE9cOxAA 3cX1bdDaTFttTqukdPXLCtD2aNwJos4vB4LYPSgugLkYaHIQH9d1NQPhS0TlUeovnFNESLaV soihv0YmBUCyL4jE52FRoTjE6fUhYkFNqIWN2HYwkVrSap2UUJFquRVoVbPkbSup8P+D8eyd BbdxsY6f+5E8Rtz5ibVnPZTib7CyqnFokJITWjzGdIP0Gn+JWVa6jtHT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YE3PIkCFIEZcUiJXSXWWOIdJ43 j+YyFHU5hqXfECM6rzKGBeBUGTzyWcOX6YwRM4LzQDVJwYG8cVfth+v4/ImcXR43D4WVxxBE AjKag02b+1yfABEBAAGJAh8EGAECAAkFAlm/2cUCGwwACgkQE/zvid2ePE/dqQ/6ApUwgsZz tps0MOdRddjPwz44pWXS5MG45irMQXELGQyxkrafc8lwHeABYstoK8dpopTcJGE3dZGL3JNz 1YWxQ5AV4uyqBn5N8RubcA8NzR6DQP+OGPIwzMketvVC/cbbKDZqf0uTDy3jP65OFhSkTEIy nYv1Mb4JJl3Sq+haUbfWLAV5nboSuHmiZE6Bz2+TjdoVkNwHBfpqxu6MlWka+P98SUcmY8iV hPy9QC1XFOGdFDFf1kYgHW27mFwds35NQhNARgftAVz9FZXruW6tFIIfisjr3rVjD9R8VgL7 l5vMr9ylOFpepnI6+wd2X1566HW7F1Zw1DIrY2NHL7kL5635bHrJY4n7o/n7Elk/Ca/MAqzd IZxz6orfXeImsqZ6ODn4Y47PToS3Tr3bMNN9N6tmOPQZkJGHDBExbhAi/Jp8fpWxMmpVCUl6 c85cOBCR4s8tZsvGYOjR3CvqKrX4bb8GElrhOvAJa6DdmZXc7AyoVMaTvhpq3gJYKmC64oqt 7zwIHwaCxTbP6C6oUp9ENRV7nHnXN3BlvIgCo4QEs6HkDzkmgYlCEOKBiDyVMSkPDZdsspa+ K4GlU2Swi/BDJMjtDxyo+K0M81LXXxOeRfEIfPtZ3ddxBKPva1uSsuz+pbN9d1JY8Ko5T/h1 6susi2ReUyNJEJaSnjO5z13TQ1U= Organization: Red Hat Subject: Re: Control Dependencies vs C Compilers Message-ID: <47bfda8f-304e-5283-c6d6-0753037b0b2c@redhat.com> Date: Tue, 6 Oct 2020 16:16:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20201006144302.GY2628@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guys, OK, so playing the devils advocate here... > Mostly I just want the compiler people to say they'll guarantee the > behaviour if we do 'X'. If 'X' happens to be 'any dynamic branch headed > by a volatile load' that's fine by me. Is a compiler hack really the right way to go here ? After all, if you do get this feature added it will make it harder to compile the kernel with other compilers (*cough LLVM cough*), or older versions of gcc. Plus code like this is often subject to very aggressive optimization and all it takes is one bug in the compiler implementation and you lose the gains you were trying for. My suggestion as an alternative is to use assembler instead. That way you can guarantee that you get the instructions you want in the order that you want them. It should be fairly straightforward to create a macro or inline function that contains the necessary code and this can be done once and then used wherever the functionality is required. Cheers Nick