Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp849381ybf; Fri, 28 Feb 2020 08:47:56 -0800 (PST) X-Google-Smtp-Source: APXvYqxb1fV2P0NkaGp4x2b+qT6gakYV8BOLJ1rh8YXYiSaiJx0WJqz41zi1ESruPKW1bk3FgDZx X-Received: by 2002:a9d:7dc1:: with SMTP id k1mr3587127otn.265.1582908476842; Fri, 28 Feb 2020 08:47:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582908476; cv=none; d=google.com; s=arc-20160816; b=hO8hzmx+jnADrHg4jYyeDS1IWg8Dz+ACtHVFoCeXNCNVHeQotI1vsFU6fLZSIo+Rw/ Co23Kg00JlCQS8aWtMzWBAaF7k4LiiXKGEbJJ8PNKd2DO/b0GQma3wiznJ91rze2KTJs faodYnRdNu0u2/n+ox9W6TrZIkBh4dElUFh8t29W4vh5FRg+5pXWgdoN4YRUXkBPylgl apv1RFMM6uWE+ZB+kJ9EE8jPkozOqvsOu1/rFbrvUou3kN8ThmVcwqgtf+KCc2V/uMUq D99M3vR3iHgF8TDqU81rIQAP/UN1Bn1H4+kRZe5ZXTszELajB81nn8r6/lO5czQMixiv RoFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=BnK1UC8c2/CTg4QSSZm4VfbP+eP/ZMTQTgyW0tFmuUo=; b=JGjRfS09DrHPi3g/sZuFBwEoE+Rxw1i0aVs51b+Uk9GE0H7b5zoypMa81xD2MloBAB 7uI6QLQ3b8zXK9EKoOlHlO+b9C+kfy3wlr0ajyWEWSefkEZoUt+V/JcBBjRtmOxDGuQg dw5/ghqbo0pNz23pfxBUGRAmMa860CmOVWKUA8/VYF3VBjuPKmfGsLTMF4mpMHORqA8i 88jeLe1WxQJWBNe2Z4ZvWCbzXPvrN5E03EFnXTSq7e6a2nvrjxxW/RD0epvJQqmV1Av9 AFkr5r55hhHzqTN33ULyC2E+e2a58uBtkQyQo1Vekn+mScZbjuqQDee3Ev2ICx0J0nbI tOFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oKHI60QZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si2145492oir.69.2020.02.28.08.47.43; Fri, 28 Feb 2020 08:47:56 -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=@google.com header.s=20161025 header.b=oKHI60QZ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726603AbgB1Qre (ORCPT + 99 others); Fri, 28 Feb 2020 11:47:34 -0500 Received: from mail-qk1-f201.google.com ([209.85.222.201]:55693 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbgB1Qrd (ORCPT ); Fri, 28 Feb 2020 11:47:33 -0500 Received: by mail-qk1-f201.google.com with SMTP id t186so3300109qkh.22 for ; Fri, 28 Feb 2020 08:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=BnK1UC8c2/CTg4QSSZm4VfbP+eP/ZMTQTgyW0tFmuUo=; b=oKHI60QZm2rlT6eBR6VI7kjQy/pmu9oHGrNy5GtFXYulqvu2WVhbxI6VKR0aJSZo0s 0Kq8RgQ5pC99AQczsAgQNGlqf5AXSdoRFDll9Cu30Ikbq3MPnZlbObjMyBsGSEW5/u3J DV5rRIbYPHCudOQB2m87fmFy+50kFlUtQmLWzfU6IixBggrmfSm1gAmArDijGrlaoC8X 1ZB0cGKlwNlTE/lvavlzG7Hi+X/7o+WUo9ITg9o6wcelcRa+ZW6pIk++JzmDMB/YQ1St JssiVMa/xjuZRwv0j4u6iF4r981UiGPtXMC5+JbwHrvqMQBDiMFuS3tby67vkeVHyjR5 VAGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=BnK1UC8c2/CTg4QSSZm4VfbP+eP/ZMTQTgyW0tFmuUo=; b=Bh2RKaxnA6t+oO9ZcctS6MNPlZVELYuogXmtK6js4y6Jkmv4v4KiKMzaRnenBFLH/D ubvbqAODSBVnALIKjYORlYAJPPQFM+at5nVhZVCaP9Cr4R2FVGJ8nqbjYnZNe3wav4kg 8KyUZqZqOVTgpRpKmwO2Q6V1UDVlRJa/B/uXAaU6eif1M/F13DcgfMXCiXPuO4w3MtM5 kbr3R+p/uuCk1rkE2ItAWw6AlFGOJFahIcXBMxWxn//CmYER/EcmA73ErPsaDJV72kRF lk4+U5PKmteWpXlrnWqT3BMHT0z2n8Y6o7Bvx2AHSlGw39MuA3FPE4X6Zv7w5YThXu0l mWbw== X-Gm-Message-State: APjAAAUxyg8bTDebDlnD9co6ecFMLJ55Vvvt94hGEaUvc1Ornu/IiTk7 Z+6EGwN6BnhBxBwrdsK09x6AA//7Nw== X-Received: by 2002:ad4:580e:: with SMTP id dd14mr4596272qvb.84.1582908452572; Fri, 28 Feb 2020 08:47:32 -0800 (PST) Date: Fri, 28 Feb 2020 17:46:21 +0100 Message-Id: <20200228164621.87523-1-elver@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.1.481.gfbce0eb801-goog Subject: [PATCH] tools/memory-model/Documentation: Fix "conflict" definition From: Marco Elver To: elver@google.com Cc: paulmck@kernel.org, andreyknvl@google.com, glider@google.com, dvyukov@google.com, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, stern@rowland.harvard.edu, 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For language-level memory consistency models that are adaptations of data-race-free, the definition of "data race" can be summarized as "concurrent conflicting accesses, where at least one is non-sync/plain". The definition of "conflict" should not include the type of access nor whether the accesses are concurrent or not, which this patch addresses for explanation.txt. The definition of "data race" remains unchanged, but the informal definition for "conflict" is restored to what can be found in the literature. Signed-by: Marco Elver --- tools/memory-model/Documentation/explanation.txt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tools/memory-model/Documentation/explanation.txt b/tools/memory-model/Documentation/explanation.txt index e91a2eb19592a..11cf89b5b85d9 100644 --- a/tools/memory-model/Documentation/explanation.txt +++ b/tools/memory-model/Documentation/explanation.txt @@ -1986,18 +1986,15 @@ violates the compiler's assumptions, which would render the ultimate outcome undefined. In technical terms, the compiler is allowed to assume that when the -program executes, there will not be any data races. A "data race" -occurs when two conflicting memory accesses execute concurrently; -two memory accesses "conflict" if: +program executes, there will not be any data races. A "data race" +occurs if: - they access the same location, + two concurrent memory accesses "conflict"; - they occur on different CPUs (or in different threads on the - same CPU), + and at least one of the accesses is a plain access; - at least one of them is a plain access, - - and at least one of them is a store. + where two memory accesses "conflict" if they access the same + memory location, and at least one performs a write; The LKMM tries to determine whether a program contains two conflicting accesses which may execute concurrently; if it does then the LKMM says -- 2.25.1.481.gfbce0eb801-goog