aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 32618b3fe4e6..910d868808dc 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -671,6 +671,19 @@ int rcu_is_cpu_idle(void)
671} 671}
672EXPORT_SYMBOL(rcu_is_cpu_idle); 672EXPORT_SYMBOL(rcu_is_cpu_idle);
673 673
674/**
675 * __rcu_is_watching - are RCU read-side critical sections safe?
676 *
677 * Return true if RCU is watching the running CPU, which means that
678 * this CPU can safely enter RCU read-side critical sections. Unlike
679 * rcu_is_cpu_idle(), the caller of __rcu_is_watching() must have at
680 * least disabled preemption.
681 */
682bool __rcu_is_watching(void)
683{
684 return !!(atomic_read(this_cpu_ptr(&rcu_dynticks.dynticks)) & 0x1);
685}
686
674#if defined(CONFIG_PROVE_RCU) && defined(CONFIG_HOTPLUG_CPU) 687#if defined(CONFIG_PROVE_RCU) && defined(CONFIG_HOTPLUG_CPU)
675 688
676/* 689/*