Commit 77d8485a authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: improve kerneldoc for rcu_read_lock(), call_rcu(), and synchronize_rcu()

Make it explicit that new RCU read-side critical sections that start
after call_rcu() and synchronize_rcu() start might still be running
after the end of the relevant grace period.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
parent 742734ee
...@@ -450,7 +450,7 @@ extern int rcu_my_thread_group_empty(void); ...@@ -450,7 +450,7 @@ extern int rcu_my_thread_group_empty(void);
* until after the all the other CPUs exit their critical sections. * until after the all the other CPUs exit their critical sections.
* *
* Note, however, that RCU callbacks are permitted to run concurrently * Note, however, that RCU callbacks are permitted to run concurrently
* with RCU read-side critical sections. One way that this can happen * with new RCU read-side critical sections. One way that this can happen
* is via the following sequence of events: (1) CPU 0 enters an RCU * is via the following sequence of events: (1) CPU 0 enters an RCU
* read-side critical section, (2) CPU 1 invokes call_rcu() to register * read-side critical section, (2) CPU 1 invokes call_rcu() to register
* an RCU callback, (3) CPU 0 exits the RCU read-side critical section, * an RCU callback, (3) CPU 0 exits the RCU read-side critical section,
...@@ -608,11 +608,13 @@ extern void wakeme_after_rcu(struct rcu_head *head); ...@@ -608,11 +608,13 @@ extern void wakeme_after_rcu(struct rcu_head *head);
/** /**
* call_rcu() - Queue an RCU callback for invocation after a grace period. * call_rcu() - Queue an RCU callback for invocation after a grace period.
* @head: structure to be used for queueing the RCU updates. * @head: structure to be used for queueing the RCU updates.
* @func: actual update function to be invoked after the grace period * @func: actual callback function to be invoked after the grace period
* *
* The update function will be invoked some time after a full grace * The callback function will be invoked some time after a full grace
* period elapses, in other words after all currently executing RCU * period elapses, in other words after all pre-existing RCU read-side
* read-side critical sections have completed. RCU read-side critical * critical sections have completed. However, the callback function
* might well execute concurrently with RCU read-side critical sections
* that started after call_rcu() was invoked. RCU read-side critical
* sections are delimited by rcu_read_lock() and rcu_read_unlock(), * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
* and may be nested. * and may be nested.
*/ */
...@@ -622,9 +624,9 @@ extern void call_rcu(struct rcu_head *head, ...@@ -622,9 +624,9 @@ extern void call_rcu(struct rcu_head *head,
/** /**
* call_rcu_bh() - Queue an RCU for invocation after a quicker grace period. * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period.
* @head: structure to be used for queueing the RCU updates. * @head: structure to be used for queueing the RCU updates.
* @func: actual update function to be invoked after the grace period * @func: actual callback function to be invoked after the grace period
* *
* The update function will be invoked some time after a full grace * The callback function will be invoked some time after a full grace
* period elapses, in other words after all currently executing RCU * period elapses, in other words after all currently executing RCU
* read-side critical sections have completed. call_rcu_bh() assumes * read-side critical sections have completed. call_rcu_bh() assumes
* that the read-side critical sections end on completion of a softirq * that the read-side critical sections end on completion of a softirq
......
...@@ -546,9 +546,11 @@ EXPORT_SYMBOL_GPL(call_rcu); ...@@ -546,9 +546,11 @@ EXPORT_SYMBOL_GPL(call_rcu);
* *
* Control will return to the caller some time after a full grace * Control will return to the caller some time after a full grace
* period has elapsed, in other words after all currently executing RCU * period has elapsed, in other words after all currently executing RCU
* read-side critical sections have completed. RCU read-side critical * read-side critical sections have completed. Note, however, that
* sections are delimited by rcu_read_lock() and rcu_read_unlock(), * upon return from synchronize_rcu(), the caller might well be executing
* and may be nested. * concurrently with new RCU read-side critical sections that began while
* synchronize_rcu() was waiting. RCU read-side critical sections are
* delimited by rcu_read_lock() and rcu_read_unlock(), and may be nested.
*/ */
void synchronize_rcu(void) void synchronize_rcu(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment