Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1195472imu; Wed, 9 Jan 2019 13:25:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN66e7X9wrDkVZigo2uB2hqb9RxHr9GVVQ0/cAGWo6RqIKcZrFDd70TafNVRVKXYk95YnRzc X-Received: by 2002:a63:c848:: with SMTP id l8mr6854277pgi.78.1547069138246; Wed, 09 Jan 2019 13:25:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547069138; cv=none; d=google.com; s=arc-20160816; b=W6rq+Rh643encFHJs0VBWmrmFFgZEx0hSaBKmfnvFByy0YJdvJpu5zTIF59+3AfeC+ J2EJTUA3+cpA9isTY4iKfezVfJC5EyqmEndEN31ubMwE89k15b97wkRcMGrobubjHY9t 0fSVe0P5/Bu6GqiiA6Ovcv6YEuhMW4n0XM0JS3pwcOBPEiV5MJQ0bT+y7H5aPYFBhKXH SWmN8Z0je1SJZe8E93CUI85nLwQ2YR4AUem1+lqUo9seXFjam3r9zNKDX75bZ3G9Fih2 3LfDny4uZLgU6kmYOkNnoKoTjSYUNPLKAqH4hENpWY4n/VxclPR7LYnWbdocuUSy3HCc 2yvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=MnrrMogNPtH6qwx5op41GsrXj9ItrsK9e4KkNo+50os=; b=oB94CQ/EWoyRGjkjklaz9j3kQi3LY5QpbzNL/IPh69ry+4KgQiCAIVOoK3nIx1SklM sLHFljN4Vt1Dfc6ycoWEDKTJzf+gVx2IpC4Ppp4aK6jTD/Rk1GH26yRLPoubTxidjR2u UyTzPaTo6EuFoXFUCv2bl69bM+WSBbB4u3VockhgiwSCzPdmJlf61z8bYKr2wwTSgiUr QSXCVPjkWOPs9tcmYpDAuYqvAuCujdDOdOy6RfekAg0hNyH1ITS1SWunPWmu4HDCq3Hx MF8ie6HJlce2ZiMDR8RrJpOY6yspcwOib+iyAVGZaoyoDI9MyWP4SjggXPPiMyqR+R64 rVGQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9si71588448pfl.45.2019.01.09.13.25.23; Wed, 09 Jan 2019 13:25:38 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726848AbfAIVI3 (ORCPT + 99 others); Wed, 9 Jan 2019 16:08:29 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46292 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726408AbfAIVH6 (ORCPT ); Wed, 9 Jan 2019 16:07:58 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x09Kn2bU083482 for ; Wed, 9 Jan 2019 16:07:57 -0500 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0b-001b2d01.pphosted.com with ESMTP id 2pwq2x44mc-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 09 Jan 2019 16:07:56 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 9 Jan 2019 21:07:56 -0000 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 9 Jan 2019 21:07:51 -0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x09L7oRF20119704 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Jan 2019 21:07:50 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 426BDB2064; Wed, 9 Jan 2019 21:07:50 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 22A5BB2066; Wed, 9 Jan 2019 21:07:50 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.88]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 9 Jan 2019 21:07:50 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id E5E7D16C63C3; Wed, 9 Jan 2019 13:07:49 -0800 (PST) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, mingo@kernel.org Cc: stern@rowland.harvard.edu, parri.andrea@gmail.com, will.deacon@arm.com, peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, willy@infradead.org, "Paul E. McKenney" Subject: [PATCH RFC LKMM 4/7] tools/memory-model: Update README for addition of SRCU Date: Wed, 9 Jan 2019 13:07:45 -0800 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190109210706.GA27268@linux.ibm.com> References: <20190109210706.GA27268@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19010921-0040-0000-0000-000004AF34BE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010374; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000274; SDB=6.01144138; UDB=6.00593882; IPR=6.00924400; MB=3.00025056; MTD=3.00000008; XFM=3.00000015; UTC=2019-01-09 21:07:54 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19010921-0041-0000-0000-000008BA3947 Message-Id: <20190109210748.29074-4-paulmck@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-09_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901090168 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit updates the section on LKMM limitations to no longer say that SRCU is not modeled, but instead describe how LKMM's modeling of SRCU departs from the Linux-kernel implementation. TL;DR: There is no known valid use case that cares about the Linux kernel's ability to have partially overlapping SRCU read-side critical sections. Signed-off-by: Paul E. McKenney Acked-by: Andrea Parri --- tools/memory-model/README | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/tools/memory-model/README b/tools/memory-model/README index 0f2c366518c6..9d7d4f23503f 100644 --- a/tools/memory-model/README +++ b/tools/memory-model/README @@ -221,8 +221,29 @@ The Linux-kernel memory model has the following limitations: additional call_rcu() process to the site of the emulated rcu-barrier(). - e. Sleepable RCU (SRCU) is not modeled. It can be - emulated, but perhaps not simply. + e. Although sleepable RCU (SRCU) is now modeled, there + are some subtle differences between its semantics and + those in the Linux kernel. For example, the kernel + might interpret the following sequence as two partially + overlapping SRCU read-side critical sections: + + 1 r1 = srcu_read_lock(&my_srcu); + 2 do_something_1(); + 3 r2 = srcu_read_lock(&my_srcu); + 4 do_something_2(); + 5 srcu_read_unlock(&my_srcu, r1); + 6 do_something_3(); + 7 srcu_read_unlock(&my_srcu, r2); + + In contrast, LKMM will interpret this as a nested pair of + SRCU read-side critical sections, with the outer critical + section spanning lines 1-7 and the inner critical section + spanning lines 3-5. + + This difference would be more of a concern had anyone + identified a reasonable use case for partially overlapping + SRCU read-side critical sections. For more information, + please see: https://paulmck.livejournal.com/40593.html f. Reader-writer locking is not modeled. It can be emulated in litmus tests using atomic read-modify-write -- 2.17.1