aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcutree.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-08-17 17:18:46 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-08-20 12:00:16 -0400
commit7b0b759b65247cbc66384a912be9acf8d4800636 (patch)
tree085a18f506193725ab16fa61cae41f93dcc7c3e9 /include/linux/rcutree.h
parent73d4da4d360136826b36f78f5cf72b29da82c8a6 (diff)
rcu: combine duplicate code, courtesy of CONFIG_PREEMPT_RCU
The CONFIG_PREEMPT_RCU kernel configuration parameter was recently re-introduced, but as an indication of the type of RCU (preemptible vs. non-preemptible) instead of as selecting a given implementation. This commit uses CONFIG_PREEMPT_RCU to combine duplicate code from include/linux/rcutiny.h and include/linux/rcutree.h into include/linux/rcupdate.h. This commit also combines a few other pieces of duplicate code that have accumulated. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/rcutree.h')
-rw-r--r--include/linux/rcutree.h50
1 files changed, 0 insertions, 50 deletions
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 54a20c11f98d..95518e628794 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -30,59 +30,23 @@
30#ifndef __LINUX_RCUTREE_H 30#ifndef __LINUX_RCUTREE_H
31#define __LINUX_RCUTREE_H 31#define __LINUX_RCUTREE_H
32 32
33struct notifier_block;
34
35extern void rcu_sched_qs(int cpu);
36extern void rcu_bh_qs(int cpu);
37extern void rcu_note_context_switch(int cpu); 33extern void rcu_note_context_switch(int cpu);
38extern int rcu_needs_cpu(int cpu); 34extern int rcu_needs_cpu(int cpu);
39extern void rcu_cpu_stall_reset(void); 35extern void rcu_cpu_stall_reset(void);
40 36
41#ifdef CONFIG_TREE_PREEMPT_RCU 37#ifdef CONFIG_TREE_PREEMPT_RCU
42 38
43extern void __rcu_read_lock(void);
44extern void __rcu_read_unlock(void);
45extern void synchronize_rcu(void);
46extern void exit_rcu(void); 39extern void exit_rcu(void);
47 40
48#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ 41#else /* #ifdef CONFIG_TREE_PREEMPT_RCU */
49 42
50static inline void __rcu_read_lock(void)
51{
52 preempt_disable();
53}
54
55static inline void __rcu_read_unlock(void)
56{
57 preempt_enable();
58}
59
60#define synchronize_rcu synchronize_sched
61
62static inline void exit_rcu(void) 43static inline void exit_rcu(void)
63{ 44{
64} 45}
65 46
66static inline int rcu_preempt_depth(void)
67{
68 return 0;
69}
70
71#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ 47#endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */
72 48
73static inline void __rcu_read_lock_bh(void)
74{
75 local_bh_disable();
76}
77static inline void __rcu_read_unlock_bh(void)
78{
79 local_bh_enable();
80}
81
82extern void call_rcu_sched(struct rcu_head *head,
83 void (*func)(struct rcu_head *rcu));
84extern void synchronize_rcu_bh(void); 49extern void synchronize_rcu_bh(void);
85extern void synchronize_sched(void);
86extern void synchronize_rcu_expedited(void); 50extern void synchronize_rcu_expedited(void);
87 51
88static inline void synchronize_rcu_bh_expedited(void) 52static inline void synchronize_rcu_bh_expedited(void)
@@ -92,8 +56,6 @@ static inline void synchronize_rcu_bh_expedited(void)
92 56
93extern void rcu_barrier(void); 57extern void rcu_barrier(void);
94 58
95extern void rcu_check_callbacks(int cpu, int user);
96
97extern long rcu_batches_completed(void); 59extern long rcu_batches_completed(void);
98extern long rcu_batches_completed_bh(void); 60extern long rcu_batches_completed_bh(void);
99extern long rcu_batches_completed_sched(void); 61extern long rcu_batches_completed_sched(void);
@@ -101,18 +63,6 @@ extern void rcu_force_quiescent_state(void);
101extern void rcu_bh_force_quiescent_state(void); 63extern void rcu_bh_force_quiescent_state(void);
102extern void rcu_sched_force_quiescent_state(void); 64extern void rcu_sched_force_quiescent_state(void);
103 65
104#ifdef CONFIG_NO_HZ
105void rcu_enter_nohz(void);
106void rcu_exit_nohz(void);
107#else /* CONFIG_NO_HZ */
108static inline void rcu_enter_nohz(void)
109{
110}
111static inline void rcu_exit_nohz(void)
112{
113}
114#endif /* CONFIG_NO_HZ */
115
116/* A context switch is a grace period for RCU-sched and RCU-bh. */ 66/* A context switch is a grace period for RCU-sched and RCU-bh. */
117static inline int rcu_blocking_is_gp(void) 67static inline int rcu_blocking_is_gp(void)
118{ 68{