Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5436197rwl; Tue, 21 Mar 2023 19:20:42 -0700 (PDT) X-Google-Smtp-Source: AK7set9sFyOMnNu+WJCqeQsYsSssvWPJoeKYS/IsfB334HwMs8xGLeaTKL3XzE4oWABRo90xjwZ2 X-Received: by 2002:a05:6a00:3305:b0:626:62f:38d8 with SMTP id cq5-20020a056a00330500b00626062f38d8mr3997477pfb.3.1679451642473; Tue, 21 Mar 2023 19:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679451642; cv=none; d=google.com; s=arc-20160816; b=EJSU4VTo28vHkYGpLDF1whw+eGlQRCxt6ee7aqYfDKHn2mPqKru0xO30J9XKoP/sm/ LtPQQ1Jsy1LYMTX6oLLgDtRzcjGGDy5nK21sIlDWJ6S0/uiEeGl2+ItrLR4dqxDOLXmz WD0fqkRkTZmnxkizQi7hFgTZjDqDO1X8Ws0QzvzS/JbhjKNW5oJlDiIeMKLI8iAjjWE8 qSiBIe/CiNq7d5J4hQw7O3B6VPDJTIp3Y5BSE8RRzacx8U0+xgytCMRZYY9F2/+CnNWb TuflvrRh3cvUVlUuQCUOSqtmBFihPWtN79IEp1m9C0EtFd6fnpYEBpWh//DH0m7YiDH6 ItAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FXmlWsfpHidjnzMMfJhnUbznIcU3qDUMNvteO7VcB5A=; b=SKmLAa1zfnPhpy+UeyW21kuZ6lQrOHyOjS3qq3MDFo5WYbY1VsFlrsDK8+ZmM+mBHF amjaKamZm3PkPWPoO2/d4L/dzc/Vl5j+HA3t0+HtY/5xM8dPID3OJmf/fYUJTUy0S/83 liO22dv33Dfaztu5hbVGqi5Y0AmcBa1BitkCxDy0p5pC/4F2jqtN8RP3XnYEnHlfLbG5 N9BQsNY3QNd17VDpGzaBlbfIsK/bOnc4zWqS2QbOVhlcKfjClT8sZ8D7Q31Tzhwc39Ve lCkn/46R4GkeEc6NdAOYwy2VGiXSSOEe1/BSqoTYunWkCRZPbsecyPUSoJ3T3Z6SpWu7 vwog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=RMxoO7oS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l24-20020a63ea58000000b0050fa02c0326si4181572pgk.277.2023.03.21.19.20.30; Tue, 21 Mar 2023 19:20:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=RMxoO7oS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbjCVCR3 (ORCPT + 99 others); Tue, 21 Mar 2023 22:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjCVCR1 (ORCPT ); Tue, 21 Mar 2023 22:17:27 -0400 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CE6F59E7C for ; Tue, 21 Mar 2023 19:17:26 -0700 (PDT) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-544f7c176easo169540187b3.9 for ; Tue, 21 Mar 2023 19:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1679451445; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FXmlWsfpHidjnzMMfJhnUbznIcU3qDUMNvteO7VcB5A=; b=RMxoO7oSwkzKqjHaV+Bo8mIUTpsxaztVLZ4vz6mi4hzfQV+R4NSRXWMnLKwnWuzeaY JmkfT/dycDTyyiKWbg0P3TgHiZQupruPxfbCvxByU09HATYSU0aCQBOCUp7QaHy++Udh HNS4ONj7SQnAe6xqeFHklnV6a2NgfdulJS+gM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679451445; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FXmlWsfpHidjnzMMfJhnUbznIcU3qDUMNvteO7VcB5A=; b=SEzq+rL9jVUI8rxWQSewCFioR1hMZUnAKnaXXmA8TNxCRNFPTho87ZjUMgx9FV8qfg cCoy8dJARwRBFdbY0AFCnmHneuQXGd7Bv8r8sGKJwy8Zo0nH6N41anDygSwAreab9Qju /fE4i5Nf3NLmNIdw0wHuf9kBby6HpBS03W47FlwdgR906vIv/VxNXoGDJfb1XImMOY3H oRJ+lPhZN7uC4PVkf96B8GZECQ5KWpvi6TSGhuXpEDRZhamNtGCZPC8rr+sXvOHeEUez MrrhQpBJvtRgwM6wXKm4GM1UBAU/3U4xesm9gyzK2IOFYaZTLYzgTuCkZ28B4JyC22Ez 3LOQ== X-Gm-Message-State: AAQBX9cflrap93wNL2bOtHhkfU/E4p3Tor6XFXcu8fwNwNSfgDEgZ1PD 7xx+7AAK/HLVSQWFXmQPDAoGnHqVgB4naoYZk2QBdg== X-Received: by 2002:a81:ad53:0:b0:541:693f:cdd1 with SMTP id l19-20020a81ad53000000b00541693fcdd1mr2386512ywk.9.1679451445522; Tue, 21 Mar 2023 19:17:25 -0700 (PDT) MIME-Version: 1.0 References: <778147e4-ccab-40cf-b6ef-31abe4e3f6b7@paulmck-laptop> <20230321010246.50960-7-paulmck@kernel.org> In-Reply-To: From: Joel Fernandes Date: Tue, 21 Mar 2023 22:17:14 -0400 Message-ID: Subject: Re: [PATCH memory-model 7/8] tools/memory-model: Add documentation about SRCU read-side critical sections To: Andrea Parri Cc: "Paul E. McKenney" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, kernel-team@meta.com, mingo@kernel.org, stern@rowland.harvard.edu, 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, Andrea Parri , Jonas Oberhauser , "Paul E. McKenney" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 21, 2023 at 9:40=E2=80=AFPM Andrea Parri wrote: > > On Mon, Mar 20, 2023 at 06:02:45PM -0700, Paul E. McKenney wrote: > > From: Alan Stern > > > > Expand the discussion of SRCU and its read-side critical sections in > > the Linux Kernel Memory Model documentation file explanation.txt. The > > new material discusses recent changes to the memory model made in > > commit 6cd244c87428 ("tools/memory-model: Provide exact SRCU > > semantics"). > > How about squashing the diff below (adjusting subject and changelog): > > Andrea > > diff --git a/tools/memory-model/Documentation/litmus-tests.txt b/tools/me= mory-model/Documentation/litmus-tests.txt > index 26554b1c5575e..acac527328a1f 100644 > --- a/tools/memory-model/Documentation/litmus-tests.txt > +++ b/tools/memory-model/Documentation/litmus-tests.txt > @@ -1028,32 +1028,7 @@ Limitations of the Linux-kernel memory model (LKMM= ) include: > additional call_rcu() process to the site of the > emulated rcu-barrier(). > > - 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 =3D srcu_read_lock(&my_srcu); > - 2 do_something_1(); > - 3 r2 =3D 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 overlappin= g > - SRCU read-side critical sections. For more information > - on the trickiness of such overlapping, please see: > - https://paulmck.livejournal.com/40593.html > - > - f. Reader-writer locking is not modeled. It can be > + e. Reader-writer locking is not modeled. It can be > emulated in litmus tests using atomic read-modify-write Good point! And for the diff: Reviewed-by: Joel Fernandes (Google) thanks, - Joel > operations. > > > Andrea