aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcutiny.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/rcutiny.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/rcutiny.h')
-rw-r--r--include/linux/rcutiny.h51
1 files changed, 0 insertions, 51 deletions
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index c6b11dc5ba0a..13877cb93a60 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -27,34 +27,10 @@
27 27
28#include <linux/cache.h> 28#include <linux/cache.h>
29 29
30void rcu_sched_qs(int cpu);
31void rcu_bh_qs(int cpu);
32
33#ifdef CONFIG_TINY_RCU
34#define __rcu_read_lock() preempt_disable()
35#define __rcu_read_unlock() preempt_enable()
36#else /* #ifdef CONFIG_TINY_RCU */
37void __rcu_read_lock(void);
38void __rcu_read_unlock(void);
39#endif /* #else #ifdef CONFIG_TINY_RCU */
40#define __rcu_read_lock_bh() local_bh_disable()
41#define __rcu_read_unlock_bh() local_bh_enable()
42extern void call_rcu_sched(struct rcu_head *head,
43 void (*func)(struct rcu_head *rcu));
44
45#define rcu_init_sched() do { } while (0) 30#define rcu_init_sched() do { } while (0)
46 31
47extern void synchronize_sched(void);
48
49#ifdef CONFIG_TINY_RCU 32#ifdef CONFIG_TINY_RCU
50 33
51#define call_rcu call_rcu_sched
52
53static inline void synchronize_rcu(void)
54{
55 synchronize_sched();
56}
57
58static inline void synchronize_rcu_expedited(void) 34static inline void synchronize_rcu_expedited(void)
59{ 35{
60 synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */ 36 synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */
@@ -67,7 +43,6 @@ static inline void rcu_barrier(void)
67 43
68#else /* #ifdef CONFIG_TINY_RCU */ 44#else /* #ifdef CONFIG_TINY_RCU */
69 45
70void synchronize_rcu(void);
71void rcu_barrier(void); 46void rcu_barrier(void);
72void synchronize_rcu_expedited(void); 47void synchronize_rcu_expedited(void);
73 48
@@ -83,25 +58,6 @@ static inline void synchronize_rcu_bh_expedited(void)
83 synchronize_sched(); 58 synchronize_sched();
84} 59}
85 60
86struct notifier_block;
87
88#ifdef CONFIG_NO_HZ
89
90extern void rcu_enter_nohz(void);
91extern void rcu_exit_nohz(void);
92
93#else /* #ifdef CONFIG_NO_HZ */
94
95static inline void rcu_enter_nohz(void)
96{
97}
98
99static inline void rcu_exit_nohz(void)
100{
101}
102
103#endif /* #else #ifdef CONFIG_NO_HZ */
104
105#ifdef CONFIG_TINY_RCU 61#ifdef CONFIG_TINY_RCU
106 62
107static inline void rcu_preempt_note_context_switch(void) 63static inline void rcu_preempt_note_context_switch(void)
@@ -117,11 +73,6 @@ static inline int rcu_needs_cpu(int cpu)
117 return 0; 73 return 0;
118} 74}
119 75
120static inline int rcu_preempt_depth(void)
121{
122 return 0;
123}
124
125#else /* #ifdef CONFIG_TINY_RCU */ 76#else /* #ifdef CONFIG_TINY_RCU */
126 77
127void rcu_preempt_note_context_switch(void); 78void rcu_preempt_note_context_switch(void);
@@ -141,8 +92,6 @@ static inline void rcu_note_context_switch(int cpu)
141 rcu_preempt_note_context_switch(); 92 rcu_preempt_note_context_switch();
142} 93}
143 94
144extern void rcu_check_callbacks(int cpu, int user);
145
146/* 95/*
147 * Return the number of grace periods. 96 * Return the number of grace periods.
148 */ 97 */