From patchwork Thu Jun 28 12:33:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 140437 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2128766ljj; Thu, 28 Jun 2018 05:34:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKphNtEGYlH1Vxn1NHOfMZE37sYc9fkcWinNlEGvQBxF9pe69o1LbEvglASBDiTu82j/y6q X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr10165424plg.68.1530189256234; Thu, 28 Jun 2018 05:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530189256; cv=none; d=google.com; s=arc-20160816; b=TVTNpLyns1Z7UouE1vmpYmpPxwPyBhSffWzShzU7nBt87/fTthCeTyyL8sLBrlPeW1 jztRl2ybIHkFIpT4vohT85thljIFs28nM/LVzsJTjmY5iX81dA0qyk60KsyxxnRj+k4O z1p1/zS8P0S3EypuWsB+7rs2DRciWlawvvONDsAqn1/ofbKHlvMlimGdVrEh5ecATJak cnTZvIZiOlUhlk0rTg54ZIzfi3wTaAQ6eb/SI/Y8mUtczEqbJzwFfxyHe+3wuzhimp32 WTNUWFk9wGISr8pguME6k9PlCu42LrI/wPqDnKNa6dk7/MRT0FvG+9oRwgfCGZZktqwo iR/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=MaEKqQ4yrhyoPq4k998DhTByzu47qfX2aAFyiymtVUo=; b=MpOeHXVW71E+56mXAPYaFL3YhH4QImvtHmwN8fs7Z+MtMK3z6jGeDt2qmogYp/JFZU xE0F3IKc6GZ7Qn8ZRf0rs5QIxv4gA+dN7YazHZdPJWCZvhtKeMviyMeuRUFsUmUAzW4N OWjPsSD1GbR55imT2ReUjJt3q33lCRmgK7KIRpzOZgCY4BwccBEZE9UXfQuqsZzZdHVm 7tbCEjhbEjarJLaeyNHMOJo3Kg8K4m1MAKCYQ9eBXpj6X0FvmM5/gNtQ8Qo0SOECXxkI 3kYHpr0BNixRaK8YUhzkFn9cXT2p43V+X0FIbrcUHkCWditATJ1UF2+Bhl/Pke58IzMo WR9w== 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 89-v6si6428700plf.224.2018.06.28.05.34.15; Thu, 28 Jun 2018 05:34:16 -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; 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 S934887AbeF1MeC (ORCPT + 31 others); Thu, 28 Jun 2018 08:34:02 -0400 Received: from foss.arm.com ([217.140.101.70]:46672 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753549AbeF1Md5 (ORCPT ); Thu, 28 Jun 2018 08:33:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 14C231529; Thu, 28 Jun 2018 05:33:57 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D416A3F5C0; Thu, 28 Jun 2018 05:33:54 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: akiyks@gmail.com, andrea.parri@amarulasolutions.com, boqun.feng@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, mark.rutland@arm.com, npiggin@gmail.com, paulmck@linux.vnet.ibm.com, peterz@infradead.org, stern@rowland.harvard.edu, will.deacon@arm.com Subject: [PATCH 1/2] tools/memory-model: remove ACCESS_ONCE() from recipes Date: Thu, 28 Jun 2018 13:33:46 +0100 Message-Id: <20180628123347.52963-2-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180628123347.52963-1-mark.rutland@arm.com> References: <20180628123347.52963-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit: b899a850431e2dd0 ("compiler.h: Remove ACCESS_ONCE()") ... there has been no definition of ACCESS_ONCE() in the kernel tree, and it has been necessary to use READ_ONCE() or WRITE_ONCE() instead. Let's update the exmaples in recipes.txt likewise for consistency, using READ_ONCE() for reads. Signed-off-by: Mark Rutland Cc: Alan Stern Cc: Andrea Parri Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Nicholas Piggin Cc: David Howells Cc: Jade Alglave Cc: Luc Maranget Cc: Paul E. McKenney Cc: Akira Yokosawa --- tools/memory-model/Documentation/recipes.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/tools/memory-model/Documentation/recipes.txt b/tools/memory-model/Documentation/recipes.txt index ee4309a87fc4..1fea8ef2b184 100644 --- a/tools/memory-model/Documentation/recipes.txt +++ b/tools/memory-model/Documentation/recipes.txt @@ -322,9 +322,9 @@ the following write-side code fragment: And the xlog_valid_lsn() function in fs/xfs/xfs_log_priv.h contains the corresponding read-side code fragment: - cur_cycle = ACCESS_ONCE(log->l_curr_cycle); + cur_cycle = READ_ONCE(log->l_curr_cycle); smp_rmb(); - cur_block = ACCESS_ONCE(log->l_curr_block); + cur_block = READ_ONCE(log->l_curr_block); Alternatively, consider the following comment in function perf_output_put_handle() in kernel/events/ring_buffer.c: From patchwork Thu Jun 28 12:33:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 140436 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2128532ljj; Thu, 28 Jun 2018 05:34:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf47hmMPSXVLE8xPpbbO2TmxrViRFZj2vHZQoToXlJJUEwzeM43CPPAenFIgN7ChYDzZ6ce X-Received: by 2002:a62:8a83:: with SMTP id o3-v6mr10081964pfk.12.1530189244891; Thu, 28 Jun 2018 05:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530189244; cv=none; d=google.com; s=arc-20160816; b=VVCmrHYD280ajJpwPYrRmmmih4u7DyFz4x1LUFknI6erD/0FUO5qlfdTHhlx1Mtte6 QlIsGA+wOXQhFAUxBwPW9RgycsNhic93wyVmVLZEI4Z7hN0jjJ8bo2HoUyUzHsRBZmML Ll1bzuEkMwKuPji3E5I5SPDiX6vZagp6CSk1oqSO9gy9AE5w1LFlDKye73Q3xZissKap RttoIFms/ZH6UWANvHOgtuBVyzvE2qVN9djqnDuhAMJsA+6WsSAXpoc7d5BdlXrfnGwt VSItx7u1WUJ1nI2u7v107MBIU15gHd8Iwyhc1esN9GQw9WLYLgDgeOLgKtugSVEEuChS SgiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=OqhNMsb50bqNFjqShDJDKY8KWLJf3D2g6D7c+genLqQ=; b=edeaXvVZd0yJS5lZyUKoKyVqtxoMJuUJ9fAjTlxaNRkirc0eKXdytrFpTxGF/WTkjQ CIeKwuZpMzJgf1B2Wr3c1pWxLlTR/uWD4n3x99jXrIXgRL5uztcHTPU+wKJRdCeXW/Im XIjbx8NE12hAGaWRZhdLU4sQYJZ2Jse3P2UGQF/jdpG2B4EBmJJaaw7ievqDW3TCWGTC J1ef1kZEKQhaGro59+S6P0mG7cAe4KHq33Ce7134DOxNMsGiOK+gZ8rs1kMB8IdTUWS3 +N8UQ0mo1rrFs20qUhsYHQSpy8bXaKROQhn9cfh5dEdLvN3VvPERXHynFD/F/oxghvsS gTqw== 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 m12-v6si6703754pfd.348.2018.06.28.05.34.04; Thu, 28 Jun 2018 05:34:04 -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; 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 S1753777AbeF1MeD (ORCPT + 31 others); Thu, 28 Jun 2018 08:34:03 -0400 Received: from foss.arm.com ([217.140.101.70]:46694 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753714AbeF1MeA (ORCPT ); Thu, 28 Jun 2018 08:34:00 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F241C15AD; Thu, 28 Jun 2018 05:33:59 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BE9133F5C0; Thu, 28 Jun 2018 05:33:57 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: akiyks@gmail.com, andrea.parri@amarulasolutions.com, boqun.feng@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, mark.rutland@arm.com, npiggin@gmail.com, paulmck@linux.vnet.ibm.com, peterz@infradead.org, stern@rowland.harvard.edu, will.deacon@arm.com Subject: [PATCH 2/2] tools/memory-model: remove ACCESS_ONCE() from model Date: Thu, 28 Jun 2018 13:33:47 +0100 Message-Id: <20180628123347.52963-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180628123347.52963-1-mark.rutland@arm.com> References: <20180628123347.52963-1-mark.rutland@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit: b899a850431e2dd0 ("compiler.h: Remove ACCESS_ONCE()") ... there has been no definition of ACCESS_ONCE() in the kernel tree, and it has been necessary to use READ_ONCE() or WRITE_ONCE() instead. Correspondingly, let's remove ACCESS_ONCE() from the kernel memory model. Signed-off-by: Mark Rutland Cc: Alan Stern Cc: Andrea Parri Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Nicholas Piggin Cc: David Howells Cc: Jade Alglave Cc: Luc Maranget Cc: Paul E. McKenney Cc: Akira Yokosawa --- tools/memory-model/linux-kernel.bell | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 diff --git a/tools/memory-model/linux-kernel.bell b/tools/memory-model/linux-kernel.bell index 64f5740e0e75..b84fb2f67109 100644 --- a/tools/memory-model/linux-kernel.bell +++ b/tools/memory-model/linux-kernel.bell @@ -13,7 +13,7 @@ "Linux-kernel memory consistency model" -enum Accesses = 'once (*READ_ONCE,WRITE_ONCE,ACCESS_ONCE*) || +enum Accesses = 'once (*READ_ONCE,WRITE_ONCE*) || 'release (*smp_store_release*) || 'acquire (*smp_load_acquire*) || 'noreturn (* R of non-return RMW *)