@@ -38,7 +38,7 @@ by having call_rcu() directly invoke its arguments only if it was called
3838from process context. However, this can fail in a similar manner.
3939
4040Suppose 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
4242on each element as it is scanned. Suppose further that this function
4343deletes element B from the list, then passes it to call_rcu() for deferred
4444freeing. This may be a bit unconventional, but it is perfectly legal
@@ -59,7 +59,8 @@ Example 3: Death by Deadlock
5959Suppose that call_rcu() is invoked while holding a lock, and that the
6060callback function must acquire this same lock. In this case, if
6161call_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
6465In some cases, it would possible to restructure to code so that
6566the 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+
8897Summary
8998-------
9099
0 commit comments