Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2335923pxb; Mon, 19 Apr 2021 03:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxigPBlOV2VbOi0sGFxJNypikivOFADT2Zp4YKQGZ8s/UWV2ZAa1Bvy0JoxM/EnUVCvSDJ+ X-Received: by 2002:aa7:d3d3:: with SMTP id o19mr8351783edr.282.1618827818918; Mon, 19 Apr 2021 03:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618827818; cv=none; d=google.com; s=arc-20160816; b=aPc10Va6PDmTXi5/T0WWy8pS3hL0Mmfr11HhGIXmpht28jaMOT0vDP5hhhU4VpQiBb MZYtJRiG9gfQOTfcfVsl4ROVcg2ImB66WpVegf+68zpuetxSftSvNmmlUusNQSEZvc7y qE7QRfx1GTL8TXeIoFSXJ4ssk+JRTlwiqsXtT2E7i7J3yN3QYPVj0GNsix0ZgVPlRxPu 6e2mgIv7YRc7PdrHvshxZQHPMlcrO804MOLdE8+SjQDG913r0RbmfVgALfoxW5wG95mp d2dP5RnpRfXUae+rfgd26Uth0CyS5ndQ3VsYjGiB7vVTesmopGzpDCcIUqDRN8Bl8HpM LOVw== 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:dkim-signature; bh=Zoaz+arrG2VoAZjnSLaqhvfG02ozKoF1dTuBza5it3M=; b=I+TbY0K83qR3L7ty7L6GXs31QuMUd3zMz7octm7ih3zGcOjsB5MjEIkFZuXaWmX0bU jua7eZhpFNfFQfLNB8QYTPsXHGnViled/I9EOLVP7iPoE8Zh8nuAhAJJvhVW9OISb5X4 7FlBu5wbOFeMJ5mkzn5DHGmIke5b6+seDRySKzJllwje1yhaiyGJ/V1z0YRvNG+PZ+1p yA2WM1mp7qMWZlIgah8a0TfyhhYHHVOmkO4WEWVtF5pjy9/oltMBDPdv0NC5Fs+NRGRm 0hsMoMT8YYAM0ZsIvfZtDGTPC6nMszJg2Zqq+UTp205p1YZ9vkmtL6QGefKZOmSeQ24o U1FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=W4oysXhU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si1316599edr.552.2021.04.19.03.23.15; Mon, 19 Apr 2021 03:23:38 -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=@infradead.org header.s=desiato.20200630 header.b=W4oysXhU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238588AbhDSJhB (ORCPT + 99 others); Mon, 19 Apr 2021 05:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbhDSJhA (ORCPT ); Mon, 19 Apr 2021 05:37:00 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6174EC06174A; Mon, 19 Apr 2021 02:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=Zoaz+arrG2VoAZjnSLaqhvfG02ozKoF1dTuBza5it3M=; b=W4oysXhUdmJlxpQdkFI2LUz+wM 8LokRUVSAv+dEETIHyKSaa6m0HVnUZbebSF23/G65TXk1zPxRuW4lOLHj2p1bmx8Mgjl0RIWhtlN5 LvRCoRNcoQfhZksJGhKmajbV27npBzi7xOVMEMZ6OVLBUHIeTeuXXMt2Ctc81SWhCVTqM9D7wP3pM GmgpI64jyAMnsgL3JI84E1C9vvZElMrQSV8s1cZpKbS2cl/FHYmFarkc+pLTAhi/otwFWmxhR3/VT 1ZnhAhY4vwyiqyDNDE9O78PwLX/h4eKlL6rsznTl1o/1Zw9DXQdBBzDeRfhzgmrVHkuB4qORDjM/s 7IpOoiCg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lYQKQ-009ZJU-N7; Mon, 19 Apr 2021 09:36:26 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DD1C130021C; Mon, 19 Apr 2021 11:36:25 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C0E762015BC7C; Mon, 19 Apr 2021 11:36:25 +0200 (CEST) Date: Mon, 19 Apr 2021 11:36:25 +0200 From: Peter Zijlstra To: Paolo Bonzini Cc: 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, Will Deacon Subject: Re: [PATCH 00/13] [RFC] Rust support Message-ID: References: <20210414184604.23473-1-ojeda@kernel.org> <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: <3a874b15-5c21-9ed9-e5c3-995f915cba79@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. I also don't see how this is better than seq_cst. But yes, not broken, but also very much not optimal.