Skip to content

Commit c8f2310

Browse files
committed
doc: Update UP.rst
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 <[email protected]>
1 parent 0c208a7 commit c8f2310

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Documentation/RCU/UP.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ by having call_rcu() directly invoke its arguments only if it was called
3838
from process context. However, this can fail in a similar manner.
3939

4040
Suppose that an RCU-based algorithm again scans a linked list containing
41-
elements A, B, and C in process contexts, but that it invokes a function
41+
elements A, B, and C in process context, but that it invokes a function
4242
on each element as it is scanned. Suppose further that this function
4343
deletes element B from the list, then passes it to call_rcu() for deferred
4444
freeing. This may be a bit unconventional, but it is perfectly legal
@@ -59,7 +59,8 @@ Example 3: Death by Deadlock
5959
Suppose that call_rcu() is invoked while holding a lock, and that the
6060
callback function must acquire this same lock. In this case, if
6161
call_rcu() were to directly invoke the callback, the result would
62-
be self-deadlock.
62+
be self-deadlock *even if* this invocation occurred from a later
63+
call_rcu() invocation a full grace period later.
6364

6465
In some cases, it would possible to restructure to code so that
6566
the call_rcu() is delayed until after the lock is released. However,
@@ -85,6 +86,14 @@ Quick Quiz #2:
8586

8687
:ref:`Answers to Quick Quiz <answer_quick_quiz_up>`
8788

89+
It is important to note that userspace RCU implementations *do*
90+
permit call_rcu() to directly invoke callbacks, but only if a full
91+
grace period has elapsed since those callbacks were queued. This is
92+
the case because some userspace environments are extremely constrained.
93+
Nevertheless, people writing userspace RCU implementations are strongly
94+
encouraged to avoid invoking callbacks from call_rcu(), thus obtaining
95+
the deadlock-avoidance benefits called out above.
96+
8897
Summary
8998
-------
9099

0 commit comments

Comments
 (0)