diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-08-17 17:18:46 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2010-08-20 12:00:16 -0400 |
commit | 7b0b759b65247cbc66384a912be9acf8d4800636 (patch) | |
tree | 085a18f506193725ab16fa61cae41f93dcc7c3e9 /include/linux/rcutree.h | |
parent | 73d4da4d360136826b36f78f5cf72b29da82c8a6 (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.h | 50 |
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 | ||
33 | struct notifier_block; | ||
34 | |||
35 | extern void rcu_sched_qs(int cpu); | ||
36 | extern void rcu_bh_qs(int cpu); | ||
37 | extern void rcu_note_context_switch(int cpu); | 33 | extern void rcu_note_context_switch(int cpu); |
38 | extern int rcu_needs_cpu(int cpu); | 34 | extern int rcu_needs_cpu(int cpu); |
39 | extern void rcu_cpu_stall_reset(void); | 35 | extern void rcu_cpu_stall_reset(void); |
40 | 36 | ||
41 | #ifdef CONFIG_TREE_PREEMPT_RCU | 37 | #ifdef CONFIG_TREE_PREEMPT_RCU |
42 | 38 | ||
43 | extern void __rcu_read_lock(void); | ||
44 | extern void __rcu_read_unlock(void); | ||
45 | extern void synchronize_rcu(void); | ||
46 | extern void exit_rcu(void); | 39 | extern void exit_rcu(void); |
47 | 40 | ||
48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 41 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
49 | 42 | ||
50 | static inline void __rcu_read_lock(void) | ||
51 | { | ||
52 | preempt_disable(); | ||
53 | } | ||
54 | |||
55 | static inline void __rcu_read_unlock(void) | ||
56 | { | ||
57 | preempt_enable(); | ||
58 | } | ||
59 | |||
60 | #define synchronize_rcu synchronize_sched | ||
61 | |||
62 | static inline void exit_rcu(void) | 43 | static inline void exit_rcu(void) |
63 | { | 44 | { |
64 | } | 45 | } |
65 | 46 | ||
66 | static 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 | ||
73 | static inline void __rcu_read_lock_bh(void) | ||
74 | { | ||
75 | local_bh_disable(); | ||
76 | } | ||
77 | static inline void __rcu_read_unlock_bh(void) | ||
78 | { | ||
79 | local_bh_enable(); | ||
80 | } | ||
81 | |||
82 | extern void call_rcu_sched(struct rcu_head *head, | ||
83 | void (*func)(struct rcu_head *rcu)); | ||
84 | extern void synchronize_rcu_bh(void); | 49 | extern void synchronize_rcu_bh(void); |
85 | extern void synchronize_sched(void); | ||
86 | extern void synchronize_rcu_expedited(void); | 50 | extern void synchronize_rcu_expedited(void); |
87 | 51 | ||
88 | static inline void synchronize_rcu_bh_expedited(void) | 52 | static inline void synchronize_rcu_bh_expedited(void) |
@@ -92,8 +56,6 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
92 | 56 | ||
93 | extern void rcu_barrier(void); | 57 | extern void rcu_barrier(void); |
94 | 58 | ||
95 | extern void rcu_check_callbacks(int cpu, int user); | ||
96 | |||
97 | extern long rcu_batches_completed(void); | 59 | extern long rcu_batches_completed(void); |
98 | extern long rcu_batches_completed_bh(void); | 60 | extern long rcu_batches_completed_bh(void); |
99 | extern long rcu_batches_completed_sched(void); | 61 | extern long rcu_batches_completed_sched(void); |
@@ -101,18 +63,6 @@ extern void rcu_force_quiescent_state(void); | |||
101 | extern void rcu_bh_force_quiescent_state(void); | 63 | extern void rcu_bh_force_quiescent_state(void); |
102 | extern void rcu_sched_force_quiescent_state(void); | 64 | extern void rcu_sched_force_quiescent_state(void); |
103 | 65 | ||
104 | #ifdef CONFIG_NO_HZ | ||
105 | void rcu_enter_nohz(void); | ||
106 | void rcu_exit_nohz(void); | ||
107 | #else /* CONFIG_NO_HZ */ | ||
108 | static inline void rcu_enter_nohz(void) | ||
109 | { | ||
110 | } | ||
111 | static 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. */ |
117 | static inline int rcu_blocking_is_gp(void) | 67 | static inline int rcu_blocking_is_gp(void) |
118 | { | 68 | { |