aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupdate.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r--include/linux/rcupdate.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index b653b4aaa8a6..2b7fc506e479 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -40,6 +40,7 @@
40#include <linux/seqlock.h> 40#include <linux/seqlock.h>
41#include <linux/lockdep.h> 41#include <linux/lockdep.h>
42#include <linux/completion.h> 42#include <linux/completion.h>
43#include <linux/debugobjects.h>
43 44
44#ifdef CONFIG_RCU_TORTURE_TEST 45#ifdef CONFIG_RCU_TORTURE_TEST
45extern int rcutorture_runnable; /* for sysctl */ 46extern int rcutorture_runnable; /* for sysctl */
@@ -79,6 +80,16 @@ extern void rcu_init(void);
79 (ptr)->next = NULL; (ptr)->func = NULL; \ 80 (ptr)->next = NULL; (ptr)->func = NULL; \
80} while (0) 81} while (0)
81 82
83/*
84 * init_rcu_head_on_stack()/destroy_rcu_head_on_stack() are needed for dynamic
85 * initialization and destruction of rcu_head on the stack. rcu_head structures
86 * allocated dynamically in the heap or defined statically don't need any
87 * initialization.
88 */
89#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
90extern void init_rcu_head_on_stack(struct rcu_head *head);
91extern void destroy_rcu_head_on_stack(struct rcu_head *head);
92#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
82static inline void init_rcu_head_on_stack(struct rcu_head *head) 93static inline void init_rcu_head_on_stack(struct rcu_head *head)
83{ 94{
84} 95}
@@ -86,6 +97,7 @@ static inline void init_rcu_head_on_stack(struct rcu_head *head)
86static inline void destroy_rcu_head_on_stack(struct rcu_head *head) 97static inline void destroy_rcu_head_on_stack(struct rcu_head *head)
87{ 98{
88} 99}
100#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
89 101
90#ifdef CONFIG_DEBUG_LOCK_ALLOC 102#ifdef CONFIG_DEBUG_LOCK_ALLOC
91 103
@@ -517,4 +529,41 @@ extern void call_rcu(struct rcu_head *head,
517extern void call_rcu_bh(struct rcu_head *head, 529extern void call_rcu_bh(struct rcu_head *head,
518 void (*func)(struct rcu_head *head)); 530 void (*func)(struct rcu_head *head));
519 531
532/*
533 * debug_rcu_head_queue()/debug_rcu_head_unqueue() are used internally
534 * by call_rcu() and rcu callback execution, and are therefore not part of the
535 * RCU API. Leaving in rcupdate.h because they are used by all RCU flavors.
536 */
537
538#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
539# define STATE_RCU_HEAD_READY 0
540# define STATE_RCU_HEAD_QUEUED 1
541
542extern struct debug_obj_descr rcuhead_debug_descr;
543
544static inline void debug_rcu_head_queue(struct rcu_head *head)
545{
546 debug_object_activate(head, &rcuhead_debug_descr);
547 debug_object_active_state(head, &rcuhead_debug_descr,
548 STATE_RCU_HEAD_READY,
549 STATE_RCU_HEAD_QUEUED);
550}
551
552static inline void debug_rcu_head_unqueue(struct rcu_head *head)
553{
554 debug_object_active_state(head, &rcuhead_debug_descr,
555 STATE_RCU_HEAD_QUEUED,
556 STATE_RCU_HEAD_READY);
557 debug_object_deactivate(head, &rcuhead_debug_descr);
558}
559#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
560static inline void debug_rcu_head_queue(struct rcu_head *head)
561{
562}
563
564static inline void debug_rcu_head_unqueue(struct rcu_head *head)
565{
566}
567#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
568
520#endif /* __LINUX_RCUPDATE_H */ 569#endif /* __LINUX_RCUPDATE_H */