Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2544695ybf; Mon, 2 Mar 2020 10:45:53 -0800 (PST) X-Google-Smtp-Source: ADFU+vt4KX3F/eYsvvzRV4s0T7ReDJRBAfLohGM9ADxTeeREMjHrxKYZEAnILL8iBHI/fc6oleDO X-Received: by 2002:a9d:6b98:: with SMTP id b24mr451592otq.200.1583174753191; Mon, 02 Mar 2020 10:45:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583174753; cv=none; d=google.com; s=arc-20160816; b=s4PkD8+Qb8k2QWENkByCsHO1SYPCcPdcX2fs6n6C8dgUSZa6aFqqwE4j37Ave4z86D zS2qkqjFYJPViNtAusOlPUwzHQ90RsfeeuE/IBOx9PrCWDcDFd8Q6hJiyR9lB810FzyH DEEpJhlQ3/ULtfinRLLIkm0+eCAEXdomYzWRGMgYJfWSyVUFH3O1sxWRYg2XH7XM05JM 9fb3Vk+ncyAgO3QZc8ow8kNxDhxSf6WiAhG9hfpisBprtKpxLBbASIAuyVm6ve2Z5t7j Z0kcqqzB14C61IgSAExPthjUxFog6QJQ3TlUam73V+OxFzpag+5UgDzc1zhjXKCbx0c0 15ig== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=xC3luU9luWif9zkpHX91xYMSIF3QvIoKNlbMxUDrpC8=; b=cKnUDro6rMugJYARURnwYO74IzQI+2VWqds3bVuuYlVFkPPiJ6EaKxB/MHsLiOeQgW RFYgtn6qssvO0TNOVHtvzzPZ+EomSfocapY63Pwj0CIbVEKdaujzLNqcvl09g/boUn3Y OsMbQI8BeMzddCoujMVTm78p2/TWN2cayZv8iQtqRsaek4qugJdbL3ETG+Pb4ATMPERz SZw4784+hIXGa1LPv809DLae39m0F7dRY/awoaPcEDe8yFvDgaw4p7NDEgl65TyE4+Fd BdQk2F1mB4BQFCLFk+qozLAGbVMwTxyLj+q9n7Ao++zSJBnj8P4D2rvhV3fDGWMgYOKL lGow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RRLY9a1v; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22si5329471otl.29.2020.03.02.10.45.41; Mon, 02 Mar 2020 10:45:53 -0800 (PST) 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=pass header.i=@kernel.org header.s=default header.b=RRLY9a1v; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727471AbgCBSoe (ORCPT + 99 others); Mon, 2 Mar 2020 13:44:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:60374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbgCBSoe (ORCPT ); Mon, 2 Mar 2020 13:44:34 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B59DE2072A; Mon, 2 Mar 2020 18:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583174673; bh=hDtYO3C32pwwl+j+MIKuWJFXKB5fFLSdOPcA9MD/Zes=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=RRLY9a1vrOr7Yi49JbXWmSNy5zp6GZtYlcn8bvKtrZwt1hgP/l4qIclinDZnBfQGD 5SZM2CmoDaDWIjnzIqh5oJrVim+7Ln4mmyp/WsUnIwIsj+vrhH/2aqN7Ptaa/z36nn p63w8tyULbT8h0OQq2UyzOz4pDkmbGaa2vWKxFkM= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 91C0B35226C8; Mon, 2 Mar 2020 10:44:33 -0800 (PST) Date: Mon, 2 Mar 2020 10:44:33 -0800 From: "Paul E. McKenney" To: Alan Stern Cc: Marco Elver , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, parri.andrea@gmail.com, will@kernel.org, peterz@infradead.org, 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, linux-arch@vger.kernel.org Subject: Re: [PATCH v3] tools/memory-model/Documentation: Fix "conflict" definition Message-ID: <20200302184433.GL2935@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200302172101.157917-1-elver@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 02, 2020 at 12:56:59PM -0500, Alan Stern wrote: > On Mon, 2 Mar 2020, Marco Elver wrote: > > > The definition of "conflict" should not include the type of access nor > > whether the accesses are concurrent or not, which this patch addresses. > > The definition of "data race" remains unchanged. > > > > The definition of "conflict" as we know it and is cited by various > > papers on memory consistency models appeared in [1]: "Two accesses to > > the same variable conflict if at least one is a write; two operations > > conflict if they execute conflicting accesses." > > > > The LKMM as well as the C11 memory model are adaptations of > > data-race-free, which are based on the work in [2]. Necessarily, we need > > both conflicting data operations (plain) and synchronization operations > > (marked). For example, C11's definition is based on [3], which defines a > > "data race" as: "Two memory operations conflict if they access the same > > memory location, and at least one of them is a store, atomic store, or > > atomic read-modify-write operation. In a sequentially consistent > > execution, two memory operations from different threads form a type 1 > > data race if they conflict, at least one of them is a data operation, > > and they are adjacent in > > > [1] D. Shasha, M. Snir, "Efficient and Correct Execution of Parallel > > Programs that Share Memory", 1988. > > URL: http://snir.cs.illinois.edu/listed/J21.pdf > > > > [2] S. Adve, "Designing Memory Consistency Models for Shared-Memory > > Multiprocessors", 1993. > > URL: http://sadve.cs.illinois.edu/Publications/thesis.pdf > > > > [3] H.-J. Boehm, S. Adve, "Foundations of the C++ Concurrency Memory > > Model", 2008. > > URL: https://www.hpl.hp.com/techreports/2008/HPL-2008-56.pdf > > > > Signed-off-by: Marco Elver > > Co-developed-by: Alan Stern > > Signed-off-by: Alan Stern > > --- > > v3: > > * Apply Alan's suggestion. > > * s/two race candidates/race candidates/ > > Looks good! Applied, thank you both! Thanx, Paul