Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28687691rwd; Wed, 5 Jul 2023 00:52:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEQQ222Fjd/hcVWdEyzmPxUMOlva9XgLzCHo5vJ5W+GIHi5bcTkojIiVMbRVDxJAsbaaAre X-Received: by 2002:a05:6359:220:b0:134:e323:f11d with SMTP id ej32-20020a056359022000b00134e323f11dmr3635419rwb.11.1688543527038; Wed, 05 Jul 2023 00:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688543526; cv=none; d=google.com; s=arc-20160816; b=IWkB5kDtw7EO6ixOgfHTOeVid5F0tpDVge0xd9fl7olFBrXwWi9RDeVX/Z1zj39fH6 BeGt1MbwhJjWP7B0BL+TYTvFqu9NkCYWw+6ZOsA0DVdJI1hIVM9K5Rz/pT4+W9UISmPN 42c/yOJZ8ONoApXUAPEhwPPwK7PIib/LW1e1R0YgY5tw+s1CciJqGkLi87f50GK4QeO5 OTOGlf2/qvN0WEpDV1CMH6H35TFVzdD9Pd114gRYXIbPzVrHGTlz4c7+IjqqoK8jw/jx xZdVE6rOWJl0wTEUJywzB/caQc0au9wjbFwPR1WYYdJrmlyMOxvFNevPx3oBQCRGQqCy 9QvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature; bh=1L/7+ADavvvyF4LSZY4sdmtXzOtp56QtTGpuC9sfCc0=; fh=2VLGiGvUaqXvU5Er8FndJ5Uz0u/Ic0wiqsWcoITfMEg=; b=QP5kKQ/FwUX12qkfQGGsViggQxnGr1/GqUYlLMh29z1Al3qophJL7uesiiMGTU2FsI qTnmrqa47U2MXowblcseoPHB8jxMu4tdfnZIS6+aWGUTo7ddFAE/xCZ7DaENdiH0NRsb ked9XjaH/tcr4jChT0ttryEQAQy76q3tYQ7HjaDtJX3HdwXzW+bHVc+HdjlN2H2h9NFK P1TFYfv2+u5/JY+ZLBKAYyBI1Ud44qHKkK3pc6ISmLFvVV9n/QyTA8lZrFHocJ7H885+ mA0jH5oSrsrCKkEQvPVUvSQNM0Bqen6Q9NNWEvbdrPCtZh/vJVorWVvep8xOjfcuG6gv YHBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=W9eUSQyj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17-20020a632011000000b00536b4c4b695si20642332pgg.136.2023.07.05.00.51.53; Wed, 05 Jul 2023 00:52:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=W9eUSQyj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231652AbjGEHF4 (ORCPT + 99 others); Wed, 5 Jul 2023 03:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbjGEHFz (ORCPT ); Wed, 5 Jul 2023 03:05:55 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C03EE1713; Wed, 5 Jul 2023 00:05:40 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-991fe70f21bso736500266b.3; Wed, 05 Jul 2023 00:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688540739; x=1691132739; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=1L/7+ADavvvyF4LSZY4sdmtXzOtp56QtTGpuC9sfCc0=; b=W9eUSQyjAn9DCw4gpTJPLbmOfWIgG2dYvKsbwEzyNUWP0Tgqv8B1bmaXn3kLsrNXpu dCmzIoVb63rzhJzvH/sEyVtExRL1BhZeuP/9kXyASV3t8wXjUmribViAj5C7qh8t0kdK HqtE9CU0YEVO45PMz+dFgTvWBsMb9FLFPSpS1noxCdvAphaDkzhc0PswbgO4vEaf30BR K73VuYXvVXdRfstJMkGf7krhiltuEIz59AUCkeSUiClQUjfM7jDge6venjBgRdnKbT5e d7UjHIEFQQP0Jjcl6QeASBG+ARjqrFuuvibml14PMEFlHlGieBou+G28CUD74W/pdCQ9 7i9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688540739; x=1691132739; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1L/7+ADavvvyF4LSZY4sdmtXzOtp56QtTGpuC9sfCc0=; b=UXO7j90EyA11BUttYtYtVYm/hGuvAZQq+2ySMA4tUvICO2tXxqKkqFWMi6cEjpH5oO 13SFaL8dqjO2HcvXArqYToOO7xM4ckFkG7kqJUV6NKXOuUZYievfHq2+NxnQIltGbRhy z/NOZZFI/GVcqnKjw3w2/aKWn41iPMWXawESuQQvmCRJR0u3WzTo3M9if/9SaLLyhplg zne7cG9YogNLrIc+wfs2uh7+G0x6Y7XQdgmz71VHPaUpEpGSYicElSI6H1dogzra+qXC nTMBNHpGf07EXb+jmrG+lwkOb7I7Cnh9/+qMR7Ts+U7YqOADnzD1Qg9t16RfpNg2NIbL XnIA== X-Gm-Message-State: ABy/qLY7Ab0mKBlQun5lccbLCfmjaYGQcJCEllJdOvx+cqqO0lV4m2Pb fIcsI1bHSy03TpFeUP8WAiE= X-Received: by 2002:a17:906:86d1:b0:988:a0d6:c4fa with SMTP id j17-20020a17090686d100b00988a0d6c4famr11346376ejy.13.1688540738741; Wed, 05 Jul 2023 00:05:38 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id e8-20020a1709062c0800b0098822e05539sm14096295ejh.191.2023.07.05.00.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 00:05:38 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 5FF2F27C005B; Wed, 5 Jul 2023 03:05:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 05 Jul 2023 03:05:35 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtrodttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpefgieegkeelgfekheetudeiiedvlefghfeffefffefgudejvefgtdfhhfet hfegjeenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhh phgvrhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunh drfhgvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Jul 2023 03:05:33 -0400 (EDT) Date: Wed, 5 Jul 2023 00:05:32 -0700 From: Boqun Feng To: Olivier Dion Cc: Mathieu Desnoyers , rnk@google.com, Alan Stern , Andrea Parri , Will Deacon , Peter Zijlstra , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Nathan Chancellor , Nick Desaulniers , Tom Rix , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, gcc@gcc.gnu.org, llvm@lists.linux.dev Subject: Re: [RFC] Bridging the gap between the Linux Kernel Memory Consistency Model (LKMM) and C11/C++11 atomics Message-ID: References: <87ttukdcow.fsf@laura> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ttukdcow.fsf@laura> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 03, 2023 at 03:20:31PM -0400, Olivier Dion wrote: [...] > NOTE: On x86-64, we found at least one corner case [7] with Clang where > a RELEASE exchange is optimized to a RELEASE store, when the returned > value of the exchange is unused, breaking the above expectations. > Although this type of optimization respect the standard "as-if" > statement, we question its pertinence since a user should simply do a > RELEASE store instead of an exchange in that case. With the > introduction of these new primitives, these type of optimizations should > be revisited. > FWIW, this is actually a LLVM bug: https://github.com/llvm/llvm-project/issues/60418 Regards, Boqun