Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp443840ybx; Mon, 4 Nov 2019 23:34:47 -0800 (PST) X-Google-Smtp-Source: APXvYqyOmak4NI97VHbt5PiZ+gpXB9V5AFvCVQ0A0eiEGUBcLPdCUGA37E9d3cvw7Weg4b3L5wK2 X-Received: by 2002:a17:906:4d93:: with SMTP id s19mr17138347eju.285.1572939287012; Mon, 04 Nov 2019 23:34:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572939287; cv=none; d=google.com; s=arc-20160816; b=v/ur+K7aqqb7gitfvytD/nCFR0+W27tSsfs5zdI9T9WxjVnb0npJk9ed3y9Nh/dpXZ 55ZAoK1Q29hUUbcnRA9N/VdiGSTPGqL+nAmPtABmR+KsmY2YClp8fZnktPof8c4Zeqz6 lJU3tz3Em2bkm8NVL4q1PjQ+iQrRSDxPyO7nO0jvzF9DsFkRxlUr6ix8e/IjPlxQYazS JA0aIPSHXt5Fp6Is3hQ4xFQBSEOicpaevDkbK1rJa6p2/lw29GdDoon2OOEx0Zs0Ny4s 5a3eEKkLQuE7Kdq9bSGCBP0FzpBIVW0DY8mi1AP1uLUZtGtnrJJzO37n4xVO8FroU5tJ LPgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=EkRYu0Ekf5R2bAPpf2M/JWgiEhUz2V6dE5+p9ovzqsg=; b=LtuuX/yZrqX0r0GkC2psODOb7fpm17voOyRoLuT0F+TZS1Va87B3DjP6K+nn9FsVyV ErvrOWRMAzGbCwwEoFLkQfkCso6GQ27JjF6kCwMbhR6P5padVytE/XmaRuFGICo2TZ8w g8r2p6nfVQB0vr9/sTVsZLCijzr0n6+zKUNYX4NUL04CAukG5VXQToBps+ug5obhBrBd G+5DCE0wdgXQ28Udny9KRWHpiwYlmh537k7Wsua7ggP4NQ0gUGq8Ka/dUDsZl8u/h4gQ ortv1CcUK1PxBh37DC/hcYShaOyCEt7vEIvtP9m4AiNRthkYbCX3XMqRodJPafz66hHe oP5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d3HPrMC7; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si6695714ejx.346.2019.11.04.23.34.22; Mon, 04 Nov 2019 23:34:46 -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=@gmail.com header.s=20161025 header.b=d3HPrMC7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387898AbfKEHdt (ORCPT + 99 others); Tue, 5 Nov 2019 02:33:49 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37974 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387484AbfKEHdt (ORCPT ); Tue, 5 Nov 2019 02:33:49 -0500 Received: by mail-pf1-f193.google.com with SMTP id c13so14520229pfp.5; Mon, 04 Nov 2019 23:33:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=EkRYu0Ekf5R2bAPpf2M/JWgiEhUz2V6dE5+p9ovzqsg=; b=d3HPrMC75mRX351XBI/x/rQuJGxRTDxpBbKEGhWDBVyK2zxOn0eoqWVxyUqmcbr+9C 73Skipj6XHhgaJTp/Vy4rVRAE7U5Z6WnHenkPSZQqMox5hjC4DxlxEHkjiFWnlyA/xWW UH9+G+C3+ytczurXKdx+v6DHkfKk4mQ2IX2up1xcBo/q5eDV+LuHmMXKTAfGcflTiyKg AVKtdDrleO1ZGJTb8OhAXVeN4XhZcp8FaxFJqL/oDfRdn7mhrBywU60UdftPFiU5q6Fe BN9HcIAhxug2GRnXwoz3vDSrBKyvl9KcQmJOredL1QikFFPG/P+lb539ip7YvwqZA9Ay Smwg== 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:mime-version :content-disposition:user-agent; bh=EkRYu0Ekf5R2bAPpf2M/JWgiEhUz2V6dE5+p9ovzqsg=; b=regL58PhW2oy0HhsE+S/INpo7jcVqOUMaxTRnmqfSmL+V35bpG+5L8zQy6QSUkgr1Q mAIyfTNyMAM+9JNyGi+pZmgZwpjIi5EGcTsC30mOt7CbxPy9ktQIp2Z6AgiMier24/wk PjfOP50m7GsRq4QZLJS06t5IqzB/v3a3gvb9lDDii08N/QyAtTyNNmX6ThRgSODR30Ja gnHAo32ZQo9Rdf55s3FoLGzhD7phbHesR0t9hL8iAm/slm1zVr0BC0chXWaeN73XU+sB XejPq7ZGxBh2AU5tQIg8vDW5UnpJ7zyZ59y/OklMOJ3rHwCtr1EkpsJH7pn8h5aEUe02 iVIw== X-Gm-Message-State: APjAAAXppaMyO4WgWIrDybi5tFxxer4cWhDG/+BsZe+eKtzj5LO9OCU9 E/BXAZSbcnbH/pyhs76IhnM= X-Received: by 2002:a63:7158:: with SMTP id b24mr34646870pgn.153.1572939228246; Mon, 04 Nov 2019 23:33:48 -0800 (PST) Received: from workstation-kernel-dev ([139.5.253.184]) by smtp.gmail.com with ESMTPSA id b9sm19581266pfp.77.2019.11.04.23.33.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 23:33:47 -0800 (PST) Date: Tue, 5 Nov 2019 13:03:40 +0530 From: Amol Grover To: "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Jonathan Corbet Cc: rcu@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Shuah Khan , Joel Fernandes , Jani Nikula , Phong Tran , Madhuparna Bhowmik Subject: [PATCH v2] Documentation: RCU: whatisRCU: Fix formatting for section 2 Message-ID: <20191105073340.GA3682@workstation-kernel-dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert RCU API methods text to sub-headings and add footnote linking to 2 literary notes under rcu_dereference() section for improved UX Signed-off-by: Amol Grover --- Documentation/RCU/whatisRCU.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Documentation/RCU/whatisRCU.rst b/Documentation/RCU/whatisRCU.rst index ae40c8bcc56c..4c6f1f595757 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); @@ -280,7 +285,7 @@ rcu_dereference() unnecessary overhead on Alpha CPUs. 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 [1]_. For example, the following is -not- legal:: rcu_read_lock(); @@ -304,9 +309,9 @@ rcu_dereference() 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() [2]_. - [1] The variant rcu_dereference_protected() can be used outside +.. [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 @@ -319,7 +324,8 @@ rcu_dereference() a lockdep splat is emitted. See Documentation/RCU/Design/Requirements/Requirements.rst and the API's code comments for more details and example usage. - [2] If the list_for_each_entry_rcu() instance might be used by + +.. [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, -- 2.20.1