Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2355261imm; Thu, 21 Jun 2018 11:05:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJqxB6T3S0/nBd5Ol8oRnBXKlI0UQWZtDuRL5+b8HdsPOq6JjT1mTf0NjPFWIKlDpi45TOB X-Received: by 2002:a62:ca4a:: with SMTP id n71-v6mr28460549pfg.14.1529604341580; Thu, 21 Jun 2018 11:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529604341; cv=none; d=google.com; s=arc-20160816; b=URbNFPDhOfunVFGT756mvh6BdiVlBsaeDQ5vT/JfCEdrbU9AMq13oagkqjYd+wXnDW PfWUJP4tuqxpcbgIOoI4ofKpcLZxQ7zOjE9s8HGuNNdRZsAEhJEozPfQlagyf489IDkb RpYu+DArYxaLancjclN815xDGkxyt9JLOH+5mNJqXhObFeDe3kXiv+A/pci+g172isI+ rnfh2K+wWZ/8EX+hGmb+r8P4TnPNvMITfyk0qGhWYGAf8a+a/66mQ8pqXUIZuIqksc+n 8Fjh/8LDdb3fKUn01Qsiydz53A3PNEMpMwgCY+gG3Yw0jnCqgYcfyGjj3seOJsgLUgo3 7O9A== 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=R3mKvH41WUz6gS/cyZlPOLo01d+3dLVHCkCIKucK9Qg=; b=lCJ1xOH26/3KyaAiND/O5/1Xl13fDBzFQGPnFrZyD29WaqG0MLKvJIcvxQh+hrOyZX +6XN0sW/x41zz/dnvB5234V+6L6PyZ31Qg42yuNvzzh+MNY0Hd2RMLv3kGE7uDFTCOVb 5Xv0cdZnT3AEEmlRnzB8qhMyyYOOiQnw44gzKAhVUQ7goQLjHxgdl8mrVhTT6hzbNtMv Keyg/fZ7ZFZlDwh+mfO4TwMfarqeWaHFRCgRJkrpTwjaNyGReKaOMS9cL4bNKfyabkvP TIp0i4g0DOu62QunzcA080GsjNvo6F1ZMUq6IG1wTisJEM2jWghzj1ts9T6P979cka7F GQAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=JEGU8Azw; 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 125-v6si1567908pgg.298.2018.06.21.11.05.25; Thu, 21 Jun 2018 11:05:41 -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=merlin.20170209 header.b=JEGU8Azw; 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 S1754080AbeFUSEq (ORCPT + 99 others); Thu, 21 Jun 2018 14:04:46 -0400 Received: from merlin.infradead.org ([205.233.59.134]:59896 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751048AbeFUSEp (ORCPT ); Thu, 21 Jun 2018 14:04:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=R3mKvH41WUz6gS/cyZlPOLo01d+3dLVHCkCIKucK9Qg=; b=JEGU8AzwRL7AmUwF6TPAVg3XR 7u+FcOLWahIcjzJd9HgoRp6LohCyT6dqJyC7PlLJv3aNCaHwivq5t1cnOHYwtuUeezAzgxitoqYIN k5HlEtw4XBAll7mkGy0Kv5ynMyUtcQmmALFcZDwqXtARQahjqDze9MkTJIJ4UyD2oQlKjJg6VbmR0 gGLk3rJ79gYLD8bNKLvofhdGbYMMKNDSN0T78CzzKmVrrztNfJJ+fLHBBmqPL2vG1XkGXKrbsVhdg 24gJ/3EWLB1c1JVIqBXiP7c43ukkvjDf9/Z9BKz+tNzAqqpEw3CHaWoBq8zuuwtK02wsFKjmLWXZZ JIT6aoYNw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fW3wX-0000i1-N5; Thu, 21 Jun 2018 18:04:25 +0000 Received: by worktop (Postfix, from userid 1000) id 442866E093A; Thu, 21 Jun 2018 20:04:22 +0200 (CEST) Date: Thu, 21 Jun 2018 20:04:22 +0200 From: Peter Zijlstra To: Alan Stern Cc: LKMM Maintainers -- Akira Yokosawa , Andrea Parri , Boqun Feng , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , "Paul E. McKenney" , Will Deacon , Kernel development list Subject: Re: [PATCH 2/2] tools/memory-model: Add write ordering by release-acquire and by locks Message-ID: <20180621180422.GF3452@worktop.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 21, 2018 at 01:27:12PM -0400, Alan Stern wrote: > More than one kernel developer has expressed the opinion that the LKMM > should enforce ordering of writes by release-acquire chains and by > locking. In other words, given the following code: > > WRITE_ONCE(x, 1); > spin_unlock(&s): > spin_lock(&s); > WRITE_ONCE(y, 1); > > or the following: > > smp_store_release(&x, 1); > r1 = smp_load_acquire(&x); // r1 = 1 > WRITE_ONCE(y, 1); > > the stores to x and y should be propagated in order to all other CPUs, > even though those other CPUs might not access the lock s or be part of > the release-acquire chain. In terms of the memory model, this means > that rel-rf-acq-po should be part of the cumul-fence relation. > > All the architectures supported by the Linux kernel (including RISC-V) > do behave this way, albeit for varying reasons. Therefore this patch > changes the model in accordance with the developers' wishes. > > Signed-off-by: Alan Stern Thanks for that Alan! Acked-by: Peter Zijlstra (Intel)