Linux RCU subsystem development
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH rcu 09/15] doc: Update UP.rst
Date: Wed,  4 Jan 2023 16:09:49 -0800	[thread overview]
Message-ID: <20230105000955.1767218-9-paulmck@kernel.org> (raw)
In-Reply-To: <20230105000945.GA1767128@paulmck-ThinkPad-P17-Gen-1>

This commit updates UP.rst to reflect changes over the past few years,
including the advent of userspace RCU libraries for constrained systems.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 Documentation/RCU/UP.rst | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/Documentation/RCU/UP.rst b/Documentation/RCU/UP.rst
index e26dda27430c8..8b20fd45f2558 100644
--- a/Documentation/RCU/UP.rst
+++ b/Documentation/RCU/UP.rst
@@ -38,7 +38,7 @@ by having call_rcu() directly invoke its arguments only if it was called
 from process context.  However, this can fail in a similar manner.
 
 Suppose that an RCU-based algorithm again scans a linked list containing
-elements A, B, and C in process contexts, but that it invokes a function
+elements A, B, and C in process context, but that it invokes a function
 on each element as it is scanned.  Suppose further that this function
 deletes element B from the list, then passes it to call_rcu() for deferred
 freeing.  This may be a bit unconventional, but it is perfectly legal
@@ -59,7 +59,8 @@ Example 3: Death by Deadlock
 Suppose that call_rcu() is invoked while holding a lock, and that the
 callback function must acquire this same lock.  In this case, if
 call_rcu() were to directly invoke the callback, the result would
-be self-deadlock.
+be self-deadlock *even if* this invocation occurred from a later
+call_rcu() invocation a full grace period later.
 
 In some cases, it would possible to restructure to code so that
 the call_rcu() is delayed until after the lock is released.  However,
@@ -85,6 +86,14 @@ Quick Quiz #2:
 
 :ref:`Answers to Quick Quiz <answer_quick_quiz_up>`
 
+It is important to note that userspace RCU implementations *do*
+permit call_rcu() to directly invoke callbacks, but only if a full
+grace period has elapsed since those callbacks were queued.  This is
+the case because some userspace environments are extremely constrained.
+Nevertheless, people writing userspace RCU implementations are strongly
+encouraged to avoid invoking callbacks from call_rcu(), thus obtaining
+the deadlock-avoidance benefits called out above.
+
 Summary
 -------
 
-- 
2.31.1.189.g2e36527f23


  parent reply	other threads:[~2023-01-05  0:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05  0:09 [PATCH rcu 0/15] Documentation updates for v6.3 Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 01/15] doc: Further updates to RCU's lockdep.rst Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 02/15] doc: Update NMI-RCU.rst Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 03/15] doc: Update rcubarrier.rst Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 04/15] doc: Update rcu_dereference.rst Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 05/15] doc: Update and wordsmith rculist_nulls.rst Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 06/15] doc: Update rcu.rst Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 07/15] doc: Update stallwarn.rst Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 08/15] doc: Update torture.rst Paul E. McKenney
2023-01-05  0:09 ` Paul E. McKenney [this message]
2023-01-05  0:09 ` [PATCH rcu 10/15] doc: Update rcu.rst URL to RCU publications Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 11/15] doc: Update whatisRCU.rst Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 12/15] doc: Document CONFIG_RCU_CPU_STALL_CPUTIME=y stall information Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 13/15] docs/RCU/rcubarrier: Adjust 'Answer' parts of QQs as definition-lists Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 14/15] docs/RCU/rcubarrier: Right-adjust line numbers in code snippets Paul E. McKenney
2023-01-05  0:09 ` [PATCH rcu 15/15] doc: Fix htmldocs build warnings of stallwarn.rst Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230105000955.1767218-9-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox