diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2023-05-23 12:22:10 +0300 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2023-07-19 23:21:28 +0300 |
commit | c924bf5a43e47d5591d527d39b474f8ca9e63c0e (patch) | |
tree | 942ef6e2c9ddf2ae5c74f7e4cbb3366d3117cf90 /kernel/rcu/tree.c | |
parent | 6716f4d39c17febf7aa4fa5f5923da67a8d10e85 (diff) | |
download | linux-c924bf5a43e47d5591d527d39b474f8ca9e63c0e.tar.xz |
rcu: Clarify rcu_is_watching() kernel-doc comment
Make it clear that this function always returns either true or false
without other planned failure modes.
Reported-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r-- | kernel/rcu/tree.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 1449cb69a0e0..f788981272f8 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -677,12 +677,16 @@ static void rcu_disable_urgency_upon_qs(struct rcu_data *rdp) } /** - * rcu_is_watching - see if RCU thinks that the current CPU is not idle + * rcu_is_watching - RCU read-side critical sections permitted on current CPU? * - * Return true if RCU is watching the running CPU, which means that this - * CPU can safely enter RCU read-side critical sections. In other words, - * if the current CPU is not in its idle loop or is in an interrupt or - * NMI handler, return true. + * Return @true if RCU is watching the running CPU and @false otherwise. + * An @true return means that this CPU can safely enter RCU read-side + * critical sections. + * + * Although calls to rcu_is_watching() from most parts of the kernel + * will return @true, there are important exceptions. For example, if the + * current CPU is deep within its idle loop, in kernel entry/exit code, + * or offline, rcu_is_watching() will return @false. * * Make notrace because it can be called by the internal functions of * ftrace, and making this notrace removes unnecessary recursion calls. |