Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2444956pxb; Mon, 19 Apr 2021 06:02:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/ictgwfDzhxSalG3wYl/4zcyYAhm1qJjsI2LElh/VUyout0KSlVHPvReSYWNbA6Fq4o2s X-Received: by 2002:a17:907:77d9:: with SMTP id kz25mr22057653ejc.153.1618837335587; Mon, 19 Apr 2021 06:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618837335; cv=none; d=google.com; s=arc-20160816; b=abAts5LEedX2sJko5iyJOQApncwdn24L2Qk1nb/O9QR6LwBE4pouhQkmA/gTUPr6Wx FiFTBEFu/Dk4y+LXLim8fK0jeNSrPjieUXmGrIQqT7Q/xr0aefyxPPRos23sopIj8PI5 3pbBvPE6EX6yDAzlN3hHe4UXRsLO+QCsesUIBzduEceMvZ/LJqRoCNkIEI+DnDmq5jFx ozgKaJCBxdI/ruFWoQb+IrgRWM3rcCJQZzaGCksTSKNPmpzcLz1yp4PL2bZgF/vJZDy8 7hZGK+0lBQ2qh4rH109vM5q2AnQC3mPJmucLSDO/AaU1Jy68R5xMeD4FzJjoaOKXGHFn YrIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6zamF+H3NrDogAJrhZENV99fWgJgIhD9WOfeMAXSeRY=; b=DruI3Fo/fW/vrA92463jlCYDRG/BTTvf5G9kQENJNWLDE1GpcBePRSLi/AyOFAfaEU lJSw+P7ViEO4zdw4rHbcOpiSrD6zoqg4rqfyXFG8xiWjR9QTC9N3SOjihfNpqvr5Fx9G wz7nS9gIQjagcOF/P0U+/RsHnWwGwTPrwFcbNxUU1KMRnaknI54MjaQ4xjfXg6hPawMH n9kCJ9aZFhqHDERscXpKiRBqRjch/LY/hLs2xN4d7XMxg3UTUHYhtsoMnIEWFlVO8k2s XCMbPhCT2cIhiOokDSSko4HxGa3wTWkqWqPv32tRMWyeS3JHP8q9Xg29h0A/2uFPzVLP w9Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JVIuru1c; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id am5si10231896ejc.530.2021.04.19.06.01.50; Mon, 19 Apr 2021 06:02:15 -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=@kernel.org header.s=k20201202 header.b=JVIuru1c; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236540AbhDSLB4 (ORCPT + 99 others); Mon, 19 Apr 2021 07:01:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:33664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234214AbhDSLB4 (ORCPT ); Mon, 19 Apr 2021 07:01:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4E53861246; Mon, 19 Apr 2021 11:01:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618830086; bh=qsDArnwJVzibESZVccOE2Q7ffEL8x4mAoZLAUkykqig=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JVIuru1c4j0f7F7o8TqoAhubCUl9A6l+IBPhqIWRTrfF1LVIkiIPu49+7WZUzUov5 7CfyPLjgnIESJVZ4rDX0xcLLYmx3IQ4qcwS4kA7WnltYEat6qvBjiCCwwJ02Ma1i7W u9pRIHojz6b0ckAGO2EWzvoqcYvL/mV6N2yTfP26k7lBwxn7LolxP9r/1OHVRBJhhO zzlpzMADappAqTjjaOXuDm+fpAOgxRAP0LW/211c3dtOUBreI6LkBnzV2sPl1qs8Ep pXZtub2VcL1F1oc97N/nJf7uEPjD38dccdg+aJq2eHst7p9katVucoHW4uZHOToDBU 0uaGPD/EL8NqA== Date: Mon, 19 Apr 2021 12:01:21 +0100 From: Will Deacon To: Paolo Bonzini Cc: Peter Zijlstra , Wedson Almeida Filho , ojeda@kernel.org, Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/13] [RFC] Rust support Message-ID: <20210419110120.GA29869@willie-the-truck> References: <7287eac3-f492-bab1-9ea8-b89ceceed560@redhat.com> <3a874b15-5c21-9ed9-e5c3-995f915cba79@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 19, 2021 at 11:40:54AM +0200, Paolo Bonzini wrote: > On 19/04/21 11:36, Peter Zijlstra wrote: > > On Mon, Apr 19, 2021 at 11:02:12AM +0200, Paolo Bonzini wrote: > > > > void writer(void) > > > > { > > > > atomic_store_explicit(&seq, seq+1, memory_order_relaxed); > > > > atomic_thread_fence(memory_order_acquire); > > > > > > This needs to be memory_order_release. The only change in the resulting > > > assembly is that "dmb ishld" becomes "dmb ish", which is not as good as the > > > "dmb ishst" you get from smp_wmb() but not buggy either. > > > > Yuck! And that is what requires the insides to be > > atomic_store_explicit(), otherwise this fence doesn't have to affect > > them. > > Not just that, even the write needs to be atomic_store_explicit in order to > avoid a data race.atomic_store_explicit https://wg21.link/P0690 was an attempt to address this, but I don't know if any of the ideas got adopted in the end. Will