aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 5ebc830297c1..61a97164abcc 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1139,22 +1139,11 @@ void rcu_nmi_exit(void)
1139} 1139}
1140 1140
1141/** 1141/**
1142 * __rcu_is_watching - are RCU read-side critical sections safe?
1143 *
1144 * Return true if RCU is watching the running CPU, which means that
1145 * this CPU can safely enter RCU read-side critical sections. Unlike
1146 * rcu_is_watching(), the caller of __rcu_is_watching() must have at
1147 * least disabled preemption.
1148 */
1149bool notrace __rcu_is_watching(void)
1150{
1151 return !rcu_dynticks_curr_cpu_in_eqs();
1152}
1153
1154/**
1155 * rcu_is_watching - see if RCU thinks that the current CPU is idle 1142 * rcu_is_watching - see if RCU thinks that the current CPU is idle
1156 * 1143 *
1157 * If the current CPU is in its idle loop and is neither in an interrupt 1144 * Return true if RCU is watching the running CPU, which means that this
1145 * CPU can safely enter RCU read-side critical sections. In other words,
1146 * if the current CPU is in its idle loop and is neither in an interrupt
1158 * or NMI handler, return true. 1147 * or NMI handler, return true.
1159 */ 1148 */
1160bool notrace rcu_is_watching(void) 1149bool notrace rcu_is_watching(void)
@@ -1162,7 +1151,7 @@ bool notrace rcu_is_watching(void)
1162 bool ret; 1151 bool ret;
1163 1152
1164 preempt_disable_notrace(); 1153 preempt_disable_notrace();
1165 ret = __rcu_is_watching(); 1154 ret = !rcu_dynticks_curr_cpu_in_eqs();
1166 preempt_enable_notrace(); 1155 preempt_enable_notrace();
1167 return ret; 1156 return ret;
1168} 1157}