* [PATCH] RCU: Adjust the comment of function rcu_is_watching
@ 2018-10-08 6:50 zhouzhouyi
2018-10-09 4:05 ` Paul E. McKenney
0 siblings, 1 reply; 2+ messages in thread
From: zhouzhouyi @ 2018-10-08 6:50 UTC (permalink / raw)
To: paulmck, josh, rostedt, mathieu.desnoyers, jiangshanlai, linux-kernel
Cc: Zhouyi Zhou
From: Zhouyi Zhou <zhouzhouyi@gmail.com>
Because RCU avoids interrupting idle CPUs, rcu_is_watching is used to
test whether or not it is currently legal to run RCU read-side
critical sections on this CPU.
First sentence and last sentence of current comment for rcu_is_watching
have opposite meaning of what is expected.
Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
---
kernel/rcu/tree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 0b760c1..adb04ea 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1010,12 +1010,12 @@ void rcu_irq_enter_irqson(void)
}
/**
- * rcu_is_watching - see if RCU thinks that the current CPU is idle
+ * rcu_is_watching - see if RCU thinks that the current CPU is not idle
*
* 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 in its idle loop and is neither in an interrupt
- * or NMI handler, return true.
+ * if the current CPU is not in its idle loop or is in an interrupt or
+ * NMI handler, return true.
*/
bool notrace rcu_is_watching(void)
{
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] RCU: Adjust the comment of function rcu_is_watching
2018-10-08 6:50 [PATCH] RCU: Adjust the comment of function rcu_is_watching zhouzhouyi
@ 2018-10-09 4:05 ` Paul E. McKenney
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2018-10-09 4:05 UTC (permalink / raw)
To: zhouzhouyi; +Cc: josh, rostedt, mathieu.desnoyers, jiangshanlai, linux-kernel
On Mon, Oct 08, 2018 at 06:50:41AM +0000, zhouzhouyi@gmail.com wrote:
> From: Zhouyi Zhou <zhouzhouyi@gmail.com>
>
> Because RCU avoids interrupting idle CPUs, rcu_is_watching is used to
> test whether or not it is currently legal to run RCU read-side
> critical sections on this CPU.
>
> First sentence and last sentence of current comment for rcu_is_watching
> have opposite meaning of what is expected.
>
> Signed-off-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Good eyes! Applied and pushed, thank you!
Thanx, Paul
> ---
> kernel/rcu/tree.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 0b760c1..adb04ea 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1010,12 +1010,12 @@ void rcu_irq_enter_irqson(void)
> }
>
> /**
> - * rcu_is_watching - see if RCU thinks that the current CPU is idle
> + * rcu_is_watching - see if RCU thinks that the current CPU is not idle
> *
> * 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 in its idle loop and is neither in an interrupt
> - * or NMI handler, return true.
> + * if the current CPU is not in its idle loop or is in an interrupt or
> + * NMI handler, return true.
> */
> bool notrace rcu_is_watching(void)
> {
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-09 4:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08 6:50 [PATCH] RCU: Adjust the comment of function rcu_is_watching zhouzhouyi
2018-10-09 4:05 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).