Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1094616ybb; Fri, 20 Mar 2020 13:16:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsUdWaQ4g3zC/ciqkncmEv1Ley4hfzkQkViGt+3J6FBGck/esA1EqLPwZ7vlJ2Z763aiHN8 X-Received: by 2002:a9d:4e94:: with SMTP id v20mr7890761otk.96.1584735374731; Fri, 20 Mar 2020 13:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584735374; cv=none; d=google.com; s=arc-20160816; b=D2mH06p1zDEQrdK8vXH9AAK+0NQsNluRrzXW+mCWJs7tJywCHZvrbWNtJssKaTi4/x P0aL32fjT7W853ALKfqkuqZXMPXdOczSyjMVs26a+ReCq9GLEX2m/vmirqxiKwmQuXYa VW67qyo7PcCgXDTqxwCJu3n5dw9Ik2sklBnlpNSNI/YOl3FIMa2qCATlDtOxAe18el1z unuLF9DeObVf4rfwzUxUBS/LjOLYGiVBriJKxlBUO/E55nOmlMmtcOoGa5V8prmwqt4v F8Mn03Z4aNJnpI2DJfub4Dmj5sSXLyu1FNtg1/4hKZXOW4j0tJzJ/GMKjhC/1AcDDwiq /v7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2sn0BMuGSscu45PVRvZZbp6v7xwjlgP6F5F8pU0hs0U=; b=K5jwUxbMnihH5rGmTTKMepNY0wrbUtgeiKfx/O0nbUOHlyimD+lUzwMmGWn7u4NOY8 YF93odu7EpybW/Pu7jicQKysXBqlP73uyRlQPIBdtbm3fKneAL/Ep3AcYFhHySVFf3sf QKhmVg/z9A3QKXgPj8R+HLyFexXgDAyW4iC7z7DA3B9Crpsz5D4H9Pib12dlTbLCkjFi GVyedYNrWayQoZlOPVhpNP0KEb4fiIo9eH1J7j+IiH4Nz/SaiuoYaIHUtZ3DTUJ8RIOc 2YOPo7OvpQP2IBSsvrNXbVJ8TAoK5CUpwa5lLgZW+dQBD7IHc2wvqy6XglD3qHMZv+kd Q3IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=LofRG8M7; 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 k70si3475937oih.24.2020.03.20.13.16.01; Fri, 20 Mar 2020 13:16:14 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=LofRG8M7; 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 S1726913AbgCTUPT (ORCPT + 99 others); Fri, 20 Mar 2020 16:15:19 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:38276 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbgCTUPS (ORCPT ); Fri, 20 Mar 2020 16:15:18 -0400 Received: by mail-qt1-f194.google.com with SMTP id z12so6143515qtq.5 for ; Fri, 20 Mar 2020 13:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2sn0BMuGSscu45PVRvZZbp6v7xwjlgP6F5F8pU0hs0U=; b=LofRG8M7jWo17M9c1WtCt8oJJftEZDNaylP/ywROMngIFroBJEImzTDG+k6ENZbeWh c5/O3SqG9HVKIgC3VxHOtmsHC0g4DYYpN9O+s98quCBtRt7Xh+VuLu2T24FzqpD8XeAD J9hkuWhKXrywN8umnbRb3BGVA4MjR9o5dxVKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2sn0BMuGSscu45PVRvZZbp6v7xwjlgP6F5F8pU0hs0U=; b=ibjJa5V/lYKDMTyrIBnvE97/zWx5lomU/oAJ2nE43Ms7SbHLvezB/JhPYwh7vx0td5 LPw6AWcm6sqbBDEtnswbmpKaxQ/06ezE3t27nVPkLSn74RYRYxCOPNXsyqBNvM3WTpnE D0gwL+MeNpJvdZFeJQq49wyNEOg3QEBP8InMvbNiqVMyzOGhrkuWWN3G7uOvhzPvEYA7 Obi612ZXuOfoJsua5C6OwBGsP2zhURM/ChVtLoy8D7Qk9yGCT1NErKqHFmop5Ikod9M2 t+2QHCN8xxY8eIY0+JNyKLPzoL5qen5aTCf3aycEa4H2IfPsBP1W9IMYOShLFiSVkHnF BB6w== X-Gm-Message-State: ANhLgQ0EBiuEMBT+5ZD7kC/mTp9PWkczIWflLxVoWzQz9W/8kuUuH9SE dRICKzxxonsfUb5EmfuFvrKwww== X-Received: by 2002:ac8:3543:: with SMTP id z3mr9723397qtb.214.1584735317574; Fri, 20 Mar 2020 13:15:17 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id q24sm5626146qtk.45.2020.03.20.13.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2020 13:15:16 -0700 (PDT) Date: Fri, 20 Mar 2020 16:15:16 -0400 From: Joel Fernandes To: Alan Stern Cc: linux-kernel@vger.kernel.org, Akira Yokosawa , Andrea Parri , Boqun Feng , Daniel Lustig , David Howells , Jade Alglave , linux-arch@vger.kernel.org, Luc Maranget , Nicholas Piggin , "Paul E. McKenney" , Peter Zijlstra , Will Deacon Subject: Re: [PATCH 1/3] LKMM: Add litmus test for RCU GP guarantee where updater frees object Message-ID: <20200320201516.GA129293@google.com> References: <20200320065552.253696-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 20, 2020 at 10:59:55AM -0400, Alan Stern wrote: > On Fri, 20 Mar 2020, Joel Fernandes (Google) wrote: > > > This adds an example for the important RCU grace period guarantee, which > > shows an RCU reader can never span a grace period. > > > > Signed-off-by: Joel Fernandes (Google) > > --- > > .../litmus-tests/RCU+sync+free.litmus | 40 +++++++++++++++++++ > > 1 file changed, 40 insertions(+) > > create mode 100644 tools/memory-model/litmus-tests/RCU+sync+free.litmus > > > > diff --git a/tools/memory-model/litmus-tests/RCU+sync+free.litmus b/tools/memory-model/litmus-tests/RCU+sync+free.litmus > > new file mode 100644 > > index 0000000000000..c4682502dd296 > > --- /dev/null > > +++ b/tools/memory-model/litmus-tests/RCU+sync+free.litmus > > @@ -0,0 +1,40 @@ > > +C RCU+sync+free > > + > > +(* > > + * Result: Never > > + * > > The following comment needs some rewriting. The grammar is somewhat > awkward and a very important "not" is missing. > > > + * This litmus test demonstrates that an RCU reader can never see a write after > > + * the grace period, if it saw writes that happen before the grace period. > > An RCU reader can never see a write that follows a grace period if it > did _not_ see writes that precede the grace period. Yes, you are right. I will change your wording to 'did not see *all* writes that precede'. > > This > > + * is a typical pattern of RCU usage, where the write before the grace period > > + * assigns a pointer, and the writes after destroy the object that the pointer > > + * points to. > > ... that the pointer used to point to. Will fix. > > + * > > + * This guarantee also implies, an RCU reader can never span a grace period and > > + * is an important RCU grace period memory ordering guarantee. > > Unnecessary comma, and it is not clear what "This" refers to. The > whole sentence should be phrased differently: > > This is one implication of the RCU grace-period guarantee, > which says (among other things) that an RCU reader cannot span > a grace period. Your wording is better, will use that. thanks, - Joel