Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4345560ybx; Mon, 4 Nov 2019 11:47:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzi4GdFLZfJYojP0AZHco5FEm7c7OK1Ro/yxYFGFgSSpwbuVGBqRRcG62OgPYSIpJPYpjbu X-Received: by 2002:a17:906:edb7:: with SMTP id sa23mr25361937ejb.327.1572896857389; Mon, 04 Nov 2019 11:47:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572896857; cv=none; d=google.com; s=arc-20160816; b=JI3dcvRhflZ/9xLrrg+USimoRq7xKAD2PtT6iXjDAT6nzUboejK7yavgxHkf9Qgi1m 1Kx6SaToWs/QNVmKaAeVAvadna/BGdGfUPG18CCFw+sqCjiY8WPmU6e6kScgWDWsEHVw H6IuEsHcFS08t51uPtRowSSekb0Errw+k2cSxsCUNeIL1GoSiXojc6In6fG9AIAX3wgN GYhPH7KTgHSbJUIHg3E6p/I7ltXP+NOKnmeS0MUT1QEG9taduFTHQ349GTQ8PKof7LCI E8j2lj12InmsL4y0nCXbeD8mgIB94zkku3tQ1cbV9waUZ520eqEsQPPERQf+tX2uWRrk qbNg== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=B+iDCw/P/AyoxNY9xKUc3f3AOamM4PB3pjk2ff1Gzi4=; b=w6mU/g99n3WJ1sfUnzZ6sEWraEqaShndoyWOTaZtDpj1oKDVkHEIAsKGoI+iEllL1+ GI+HHStHCkeyZqVwpzcqQ3Fg2hp/ty1uTxhx7fNnPW6aUR13GmFHZXsVG4DpgK9xM0cC V3aD1KT0AoHYp8wkPtozmHsKnnNnJ6wxLBNMRAbK+7lV0kmSfx6y/YgOrkTUTsPLzQdG bgiHBAa39UUz1G/UO+nKfoJl3F1nzw65JW8ifFIwwA5M1I0YMrIh7DSSf2qsrShI0ef9 Xk26O2mmKkxtGnW4LsHMQI2BRo/uP2RnMt791Vm7LvaFGAYm4MffRkqo17tm8gYPawAV iczQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lKuUkqRw; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hk1si11990986ejb.408.2019.11.04.11.47.13; Mon, 04 Nov 2019 11:47:37 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lKuUkqRw; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729450AbfKDTpd (ORCPT + 99 others); Mon, 4 Nov 2019 14:45:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:33834 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728322AbfKDTpd (ORCPT ); Mon, 4 Nov 2019 14:45:33 -0500 Received: from paulmck-ThinkPad-P72.home (28.234-255-62.static.virginmediabusiness.co.uk [62.255.234.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC90F206BA; Mon, 4 Nov 2019 19:45:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572896731; bh=zShf6R9bX9F6o40dOZzi8/vpAucOB2J9IcRU7OUWPhY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=lKuUkqRwSn7RPYMEuJbp4Xd1bFnsY3NbliJtHq+BNCUTYhoh8GFLg5Bqcbr1I7xbQ lwaqAr8VLqRQ8wGHmXqm2icU1CYw73ENQv29ewS0dFCDaqTXtB/luAoluvBJxurX+Y 9N4uj6OezOaxfszRlyYCtL3OwwjiyeoB2/OQ7up4= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 389793520B56; Mon, 4 Nov 2019 11:45:28 -0800 (PST) Date: Mon, 4 Nov 2019 11:45:28 -0800 From: "Paul E. McKenney" To: Amol Grover Cc: Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Jonathan Corbet , rcu@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Shuah Khan Subject: Re: [PATCH] Documentation: RCU: whatisRCU: Fix formatting for section 2 Message-ID: <20191104194528.GJ20975@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20191104133315.GA14499@workstation-kernel-dev> <20191104150328.GZ20975@paulmck-ThinkPad-P72> <20191104171641.GA15217@workstation-kernel-dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191104171641.GA15217@workstation-kernel-dev> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 04, 2019 at 10:46:41PM +0530, Amol Grover wrote: > On Mon, Nov 04, 2019 at 07:03:28AM -0800, Paul E. McKenney wrote: > > On Mon, Nov 04, 2019 at 07:03:15PM +0530, Amol Grover wrote: > > > Convert RCU API method text to sub-headings and > > > add hyperlink and superscript to 2 literary notes > > > under rcu_dereference() section > > > > > > Signed-off-by: Amol Grover > > > > Good stuff, but Phong Tran beat you to it. If you are suggesting > > changes to that patch, please send a reply to her email, which > > may be found here: > > > > https://lore.kernel.org/lkml/20191030233128.14997-1-tranmanphong@gmail.com/ > > > > There are several options for replying to this email listed at the > > bottom of that web page. > > Thank you Paul! And that is correct, I was suggesting changes to > that patch. However, since that patch was already integrated into > the `dev` branch, I mistakenly believed this patch could be sent > independently. Sorry for the trouble, I'll re-send the patch the > correct way. It is of course only polite to include the author of the previous patch on CC, both using the "Cc: Phong Tran " tag following your "Signed-off" by. Thanx, Paul > Thank you > Amol > > > > > > --- > > > Documentation/RCU/whatisRCU.rst | 34 +++++++++++++++++++++++++++------ > > > 1 file changed, 28 insertions(+), 6 deletions(-) > > > > > > diff --git a/Documentation/RCU/whatisRCU.rst b/Documentation/RCU/whatisRCU.rst > > > index ae40c8bcc56c..3cf6e17d0065 100644 > > > --- a/Documentation/RCU/whatisRCU.rst > > > +++ b/Documentation/RCU/whatisRCU.rst > > > @@ -150,6 +150,7 @@ later. See the kernel docbook documentation for more info, or look directly > > > at the function header comments. > > > > > > rcu_read_lock() > > > +^^^^^^^^^^^^^^^ > > > > > > void rcu_read_lock(void); > > > > > > @@ -164,6 +165,7 @@ rcu_read_lock() > > > longer-term references to data structures. > > > > > > rcu_read_unlock() > > > +^^^^^^^^^^^^^^^^^ > > > > > > void rcu_read_unlock(void); > > > > > > @@ -172,6 +174,7 @@ rcu_read_unlock() > > > read-side critical sections may be nested and/or overlapping. > > > > > > synchronize_rcu() > > > +^^^^^^^^^^^^^^^^^ > > > > > > void synchronize_rcu(void); > > > > > > @@ -225,6 +228,7 @@ synchronize_rcu() > > > checklist.txt for some approaches to limiting the update rate. > > > > > > rcu_assign_pointer() > > > +^^^^^^^^^^^^^^^^^^^^ > > > > > > void rcu_assign_pointer(p, typeof(p) v); > > > > > > @@ -245,6 +249,7 @@ rcu_assign_pointer() > > > the _rcu list-manipulation primitives such as list_add_rcu(). > > > > > > rcu_dereference() > > > +^^^^^^^^^^^^^^^^^ > > > > > > typeof(p) rcu_dereference(p); > > > > > > @@ -279,8 +284,10 @@ rcu_dereference() > > > if an update happened while in the critical section, and incur > > > unnecessary overhead on Alpha CPUs. > > > > > > +.. _back_to_1: > > > + > > > Note that the value returned by rcu_dereference() is valid > > > - only within the enclosing RCU read-side critical section [1]. > > > + only within the enclosing RCU read-side critical section |cs_1|. > > > For example, the following is -not- legal:: > > > > > > rcu_read_lock(); > > > @@ -298,15 +305,27 @@ rcu_dereference() > > > it was acquired is just as illegal as doing so with normal > > > locking. > > > > > > +.. _back_to_2: > > > + > > > As with rcu_assign_pointer(), an important function of > > > rcu_dereference() is to document which pointers are protected by > > > RCU, in particular, flagging a pointer that is subject to changing > > > at any time, including immediately after the rcu_dereference(). > > > And, again like rcu_assign_pointer(), rcu_dereference() is > > > typically used indirectly, via the _rcu list-manipulation > > > - primitives, such as list_for_each_entry_rcu() [2]. > > > + primitives, such as list_for_each_entry_rcu() |entry_2|. > > > + > > > +.. |cs_1| raw:: html > > > + > > > + [1] > > > + > > > +.. |entry_2| raw:: html > > > > > > - [1] The variant rcu_dereference_protected() can be used outside > > > + [2] > > > + > > > +.. _cs: > > > + > > > + \ :sup:`[1]`\ The variant rcu_dereference_protected() can be used outside > > > of an RCU read-side critical section as long as the usage is > > > protected by locks acquired by the update-side code. This variant > > > avoids the lockdep warning that would happen when using (for > > > @@ -317,15 +336,18 @@ rcu_dereference() > > > a lockdep expression to indicate which locks must be acquired > > > by the caller. If the indicated protection is not provided, > > > a lockdep splat is emitted. See Documentation/RCU/Design/Requirements/Requirements.rst > > > - and the API's code comments for more details and example usage. > > > + and the API's code comments for more details and example usage. :ref:`back ` > > > + > > > + > > > +.. _entry: > > > > > > - [2] If the list_for_each_entry_rcu() instance might be used by > > > + \ :sup:`[2]`\ If the list_for_each_entry_rcu() instance might be used by > > > update-side code as well as by RCU readers, then an additional > > > lockdep expression can be added to its list of arguments. > > > For example, given an additional "lock_is_held(&mylock)" argument, > > > the RCU lockdep code would complain only if this instance was > > > invoked outside of an RCU read-side critical section and without > > > - the protection of mylock. > > > + the protection of mylock. :ref:`back ` > > > > > > The following diagram shows how each API communicates among the > > > reader, updater, and reclaimer. > > > -- > > > 2.20.1 > > >