summaryrefslogtreecommitdiff
path: root/include/linux/rcutree.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-09-07 04:39:49 +0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-09-25 17:44:41 +0400
commitcc6783f788d8fe8b23ec6fc2762f5e8c9a418eee (patch)
treedfecd009a80c422393c2c6130d9a38ec7329e851 /include/linux/rcutree.h
parentc337f8f58ed7cf150651d232af8222421a71463d (diff)
downloadlinux-cc6783f788d8fe8b23ec6fc2762f5e8c9a418eee.tar.xz
rcu: Is it safe to enter an RCU read-side critical section?
There is currently no way for kernel code to determine whether it is safe to enter an RCU read-side critical section, in other words, whether or not RCU is paying attention to the currently running CPU. Given the large and increasing quantity of code shared by the idle loop and non-idle code, the this shortcoming is becoming increasingly painful. This commit therefore adds __rcu_is_watching(), which returns true if it is safe to enter an RCU read-side critical section on the currently running CPU. This function is quite fast, using only a __this_cpu_read(). However, the caller must disable preemption. Reported-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'include/linux/rcutree.h')
-rw-r--r--include/linux/rcutree.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 226169d1bd2b..293613dfd2a5 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -90,4 +90,6 @@ extern void exit_rcu(void);
extern void rcu_scheduler_starting(void);
extern int rcu_scheduler_active __read_mostly;
+extern bool __rcu_is_watching(void);
+
#endif /* __LINUX_RCUTREE_H */