Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2503865ybf; Mon, 2 Mar 2020 09:57:18 -0800 (PST) X-Google-Smtp-Source: ADFU+vuACwQAB9R7C7M7NSPUAZdvY9Dl8Xlaa8NnHLOgOTRcUkThKgzYLmObmy51gdezuCzZl+5n X-Received: by 2002:a05:6830:10da:: with SMTP id z26mr265162oto.27.1583171838330; Mon, 02 Mar 2020 09:57:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583171838; cv=none; d=google.com; s=arc-20160816; b=udMp5SVzkZPc/57dhWKKtlEvS5q2KA1vs/AbJ0liPQRnQ+YIHBJLZWliTBDKr5qjv9 dz5RxVb8RC5yY3pZYSbgO8wbR92TZb7emncwfkf8V1tLIQkPOBmDagH+EGnsczrel1Bp peeUxGNJfhSCc3pLYofdgGYrj7N+zlBhCujKs1oxecjssbyjZUx7HRa9zTjVVgGxkCQF Whzm2txxqScTwgeTs5r/TtlzV5sKTMiInunGtg862l7OdH6A/VoyWJjN/Wi5IOb6A7xs S5An2SUjnrp6wQGRQD9wULYXiDii69sbRByZBxkABMZbYZxQ+S/RPfWxCJ/fei0fPNzE rCmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=wyweNGuiEMz8LTFgBlSEjBCnY1v7Se/a96UGSXx/Fk4=; b=NEdfIVvUqTS1bQGrgLghBXJjVGZ8iVjfSDpiUNQ9FOGdaY4C2MNbhGQHL8qZCQPgjl z7lQoxIkZbOriBmVGQWCIKhKo/xbjiOET8+YFMolsBIEWTN2qJ8z1d71p9/mA0ijlXz3 UUunPLjRJSm8gkLhTyJ8tQviShuGWJ3n8WiJTqKWHHgd5A2tq5YvQHubaWbost6wtU6B i4lD6altlGObTCaEEl1Csjk400FmWByXPsOdSyIrRHqh+4/f+j/u8hvcthF20jYGXLxh EWT6FebI2quFR4SsscPkEna9Uq+jTob7DHqHz9Y2UFvFI6e/27HomHxQu5hT8CrrKcwI A4QA== ARC-Authentication-Results: i=1; mx.google.com; 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 h136si1027283oib.141.2020.03.02.09.57.04; Mon, 02 Mar 2020 09:57:18 -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; 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 S1727316AbgCBR5A (ORCPT + 99 others); Mon, 2 Mar 2020 12:57:00 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:34122 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727237AbgCBR5A (ORCPT ); Mon, 2 Mar 2020 12:57:00 -0500 Received: (qmail 4289 invoked by uid 2102); 2 Mar 2020 12:56:59 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 2 Mar 2020 12:56:59 -0500 Date: Mon, 2 Mar 2020 12:56:59 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Marco Elver cc: linux-kernel@vger.kernel.org, , , , , , , , , , , , , , Subject: Re: [PATCH v3] tools/memory-model/Documentation: Fix "conflict" definition In-Reply-To: <20200302172101.157917-1-elver@google.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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! Alan