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.h75
1 files changed, 72 insertions, 3 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 325bad7bbca9..89414d67d961 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -61,16 +61,30 @@ struct rcu_head {
61}; 61};
62 62
63/* Exported common interfaces */ 63/* Exported common interfaces */
64extern void call_rcu_sched(struct rcu_head *head,
65 void (*func)(struct rcu_head *rcu));
66extern void synchronize_sched(void);
64extern void rcu_barrier_bh(void); 67extern void rcu_barrier_bh(void);
65extern void rcu_barrier_sched(void); 68extern void rcu_barrier_sched(void);
66extern void synchronize_sched_expedited(void); 69extern void synchronize_sched_expedited(void);
67extern int sched_expedited_torture_stats(char *page); 70extern int sched_expedited_torture_stats(char *page);
68 71
69/* Internal to kernel */ 72static inline void __rcu_read_lock_bh(void)
70extern void rcu_init(void); 73{
74 local_bh_disable();
75}
76
77static inline void __rcu_read_unlock_bh(void)
78{
79 local_bh_enable();
80}
71 81
72#ifdef CONFIG_PREEMPT_RCU 82#ifdef CONFIG_PREEMPT_RCU
73 83
84extern void __rcu_read_lock(void);
85extern void __rcu_read_unlock(void);
86void synchronize_rcu(void);
87
74/* 88/*
75 * Defined as a macro as it is a very low level header included from 89 * Defined as a macro as it is a very low level header included from
76 * areas that don't even know about current. This gives the rcu_read_lock() 90 * areas that don't even know about current. This gives the rcu_read_lock()
@@ -79,7 +93,53 @@ extern void rcu_init(void);
79 */ 93 */
80#define rcu_preempt_depth() (current->rcu_read_lock_nesting) 94#define rcu_preempt_depth() (current->rcu_read_lock_nesting)
81 95
82#endif /* #ifdef CONFIG_PREEMPT_RCU */ 96#else /* #ifdef CONFIG_PREEMPT_RCU */
97
98static inline void __rcu_read_lock(void)
99{
100 preempt_disable();
101}
102
103static inline void __rcu_read_unlock(void)
104{
105 preempt_enable();
106}
107
108static inline void synchronize_rcu(void)
109{
110 synchronize_sched();
111}
112
113static inline int rcu_preempt_depth(void)
114{
115 return 0;
116}
117
118#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
119
120/* Internal to kernel */
121extern void rcu_init(void);
122extern void rcu_sched_qs(int cpu);
123extern void rcu_bh_qs(int cpu);
124extern void rcu_check_callbacks(int cpu, int user);
125struct notifier_block;
126
127#ifdef CONFIG_NO_HZ
128
129extern void rcu_enter_nohz(void);
130extern void rcu_exit_nohz(void);
131
132#else /* #ifdef CONFIG_NO_HZ */
133
134static inline void rcu_enter_nohz(void)
135{
136}
137
138static inline void rcu_exit_nohz(void)
139{
140}
141
142#endif /* #else #ifdef CONFIG_NO_HZ */
83 143
84#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 144#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
85#include <linux/rcutree.h> 145#include <linux/rcutree.h>
@@ -626,6 +686,8 @@ struct rcu_synchronize {
626 686
627extern void wakeme_after_rcu(struct rcu_head *head); 687extern void wakeme_after_rcu(struct rcu_head *head);
628 688
689#ifdef CONFIG_PREEMPT_RCU
690
629/** 691/**
630 * call_rcu() - Queue an RCU callback for invocation after a grace period. 692 * call_rcu() - Queue an RCU callback for invocation after a grace period.
631 * @head: structure to be used for queueing the RCU updates. 693 * @head: structure to be used for queueing the RCU updates.
@@ -642,6 +704,13 @@ extern void wakeme_after_rcu(struct rcu_head *head);
642extern void call_rcu(struct rcu_head *head, 704extern void call_rcu(struct rcu_head *head,
643 void (*func)(struct rcu_head *head)); 705 void (*func)(struct rcu_head *head));
644 706
707#else /* #ifdef CONFIG_PREEMPT_RCU */
708
709/* In classic RCU, call_rcu() is just call_rcu_sched(). */
710#define call_rcu call_rcu_sched
711
712#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
713
645/** 714/**
646 * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period. 715 * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period.
647 * @head: structure to be used for queueing the RCU updates. 716 * @head: structure to be used for queueing the RCU updates.