Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8224692imu; Thu, 15 Nov 2018 08:21:56 -0800 (PST) X-Google-Smtp-Source: AJdET5fG6LAyw4Y5oza7Nj7voc3OJrbNKFypd1zbp3sWW34N7k/xwWyqFuoMI3XP5S3Fm+AD/9Di X-Received: by 2002:a63:460a:: with SMTP id t10-v6mr6458445pga.197.1542298916502; Thu, 15 Nov 2018 08:21:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542298916; cv=none; d=google.com; s=arc-20160816; b=BnnULnIOZqw2hM28Vd80lZmvtg6Z2aXZGOY6NIegolMkFNcTAag/Jdkfy2cX8DvsuJ 9xzCYgO3JuV7uAuSoQO+HjZcJi7Rkkxu4P/UECqGQYgGdq18GKwgURLEo//lFueKQPL8 oBHv7m/eHVpC1BllUDwpOmtuPEE7nJzSDqrCBIG1LnPEqNEdHR/d9mgHQlK1axF3xvnH RgPLPhXYpzX+s8yTxLz/Cv600r8suTojW69dZwUYFNuEjUS8CDECzqZdBVOFm43bX8ut 6/kWpr1TTnf99tYxuDTcuArD7gn/BxfHA2kb3l8I6Sa26P4y1xtIs368c4wAmLVtF1DF ldfw== 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:subject:cc:to :from:date; bh=ck/gyxPqI5I0MhVmmz4Ll1TbT8JxSNvuAV7j+4YF72Q=; b=YqGAwO/S289zy9ForQmxV5vQ9fkIyjF9J9nq10EiY2EXYnrvXaOUnjc4hpV8zp0XgD gj55x5BaRziK4xme/zerEePxn7Uh80e4zCRBPlkgYzAP/5xrKjSXCmECrHMgj20GV5ZJ cNrXgRlr0vX+vZJS1kyw8uyiaJDvz4q/cifCbXWXeP4zq506ubqaqXyntssD0t98t6Si +Jdr1C65cEdeZ811o64wm2tYy3ft7Xde/Nc3KBwGmnU96BItQvg6CafX6cwklrZJVe7P 4IicIOH22l0IJ3ulO5qldF8ZNLKOl80DCGjeskV+cyJG/mh5FszlZrOrg7MuHJ/0TgsF fdew== 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 u72si28080040pgc.360.2018.11.15.08.21.23; Thu, 15 Nov 2018 08:21: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; 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 S2388643AbeKPC21 (ORCPT + 99 others); Thu, 15 Nov 2018 21:28:27 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:43770 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729034AbeKPC21 (ORCPT ); Thu, 15 Nov 2018 21:28:27 -0500 Received: (qmail 2969 invoked by uid 2102); 15 Nov 2018 11:19:58 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 15 Nov 2018 11:19:58 -0500 Date: Thu, 15 Nov 2018 11:19:58 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Paul E. McKenney" cc: LKMM Maintainers -- Akira Yokosawa , Andrea Parri , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , Luc Maranget , Nicholas Piggin , Peter Zijlstra , Will Deacon , Kernel development list Subject: [PATCH 2/3] tools/memory-model: Refactor some RCU relations 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 In preparation for adding support for SRCU, refactor the definitions of rcu-fence, rcu-rscsi, rcu-link, and rb by moving the po and po? terms from the first two to the second two. An rcu-gp relation is added; it is equivalent to gp with the po and po? terms removed. This is necessary because for SRCU, we will have to use the loc relation to check that the terms at the start and end of each disjunct in the definition of rcu-fence refer to the same srcu_struct location. If these terms are hidden behind po and po?, there's no way to carry out this check. Signed-off-by: Alan Stern --- tools/memory-model/linux-kernel.cat | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) Index: usb-4.x/tools/memory-model/linux-kernel.cat =================================================================== --- usb-4.x.orig/tools/memory-model/linux-kernel.cat +++ usb-4.x/tools/memory-model/linux-kernel.cat @@ -91,32 +91,37 @@ acyclic pb as propagation (*******) (* - * Effect of read-side critical section proceeds from the rcu_read_lock() - * onward on the one hand and from the rcu_read_unlock() backwards on the + * Effects of read-side critical sections proceed from the rcu_read_unlock() + * backwards on the one hand, and from the rcu_read_lock() forwards on the * other hand. + * + * In the definition of rcu-fence below, the po term at the left-hand side + * of each disjunct and the po? term at the right-hand end have been factored + * out. They have been moved into the definitions of rcu-link and rb. *) -let rcu-rscsi = po ; rcu-rscs^-1 ; po? +let rcu-gp = [Sync-rcu] (* Compare with gp *) +let rcu-rscsi = rcu-rscs^-1 (* * The synchronize_rcu() strong fence is special in that it can order not * one but two non-rf relations, but only in conjunction with an RCU * read-side critical section. *) -let rcu-link = hb* ; pb* ; prop +let rcu-link = po? ; hb* ; pb* ; prop ; po (* * Any sequence containing at least as many grace periods as RCU read-side * critical sections (joined by rcu-link) acts as a generalized strong fence. *) -let rec rcu-fence = gp | - (gp ; rcu-link ; rcu-rscsi) | - (rcu-rscsi ; rcu-link ; gp) | - (gp ; rcu-link ; rcu-fence ; rcu-link ; rcu-rscsi) | - (rcu-rscsi ; rcu-link ; rcu-fence ; rcu-link ; gp) | +let rec rcu-fence = rcu-gp | + (rcu-gp ; rcu-link ; rcu-rscsi) | + (rcu-rscsi ; rcu-link ; rcu-gp) | + (rcu-gp ; rcu-link ; rcu-fence ; rcu-link ; rcu-rscsi) | + (rcu-rscsi ; rcu-link ; rcu-fence ; rcu-link ; rcu-gp) | (rcu-fence ; rcu-link ; rcu-fence) (* rb orders instructions just as pb does *) -let rb = prop ; rcu-fence ; hb* ; pb* +let rb = prop ; po ; rcu-fence ; po? ; hb* ; pb* irreflexive rb as rcu