Skip to content

Commit c924bf5

Browse files
committed
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 <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Joel Fernandes (Google) <[email protected]>
1 parent 6716f4d commit c924bf5

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

kernel/rcu/tree.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -677,12 +677,16 @@ static void rcu_disable_urgency_upon_qs(struct rcu_data *rdp)
677677
}
678678

679679
/**
680-
* rcu_is_watching - see if RCU thinks that the current CPU is not idle
680+
* rcu_is_watching - RCU read-side critical sections permitted on current CPU?
681681
*
682-
* Return true if RCU is watching the running CPU, which means that this
683-
* CPU can safely enter RCU read-side critical sections. In other words,
684-
* if the current CPU is not in its idle loop or is in an interrupt or
685-
* NMI handler, return true.
682+
* Return @true if RCU is watching the running CPU and @false otherwise.
683+
* An @true return means that this CPU can safely enter RCU read-side
684+
* critical sections.
685+
*
686+
* Although calls to rcu_is_watching() from most parts of the kernel
687+
* will return @true, there are important exceptions. For example, if the
688+
* current CPU is deep within its idle loop, in kernel entry/exit code,
689+
* or offline, rcu_is_watching() will return @false.
686690
*
687691
* Make notrace because it can be called by the internal functions of
688692
* ftrace, and making this notrace removes unnecessary recursion calls.

0 commit comments

Comments
 (0)