diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-25 11:42:24 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-03 06:23:04 -0400 |
commit | a979241c532f07c201fe94e0a632107268f02578 (patch) | |
tree | f7022c71b4f9671c985398426662259d723e912b /include/linux/rcupreempt.h | |
parent | 6258c4fb59e77d748f7efc2c137ad420372edd07 (diff) |
kmemtrace, rcu: fix rcupreempt.c data structure dependencies
Impact: cleanup
We want to remove percpu.h from rcupreempt.h, but if we do that
the percpu primitives there wont build anymore. Move them to the
.c file instead.
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Cc: paulmck@linux.vnet.ibm.com
LKML-Reference: <1237898630.25315.83.camel@penberg-laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/rcupreempt.h')
-rw-r--r-- | include/linux/rcupreempt.h | 51 |
1 files changed, 9 insertions, 42 deletions
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index 74304b4538d8..3eb8fdd19445 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h | |||
@@ -40,30 +40,15 @@ | |||
40 | #include <linux/cpumask.h> | 40 | #include <linux/cpumask.h> |
41 | #include <linux/seqlock.h> | 41 | #include <linux/seqlock.h> |
42 | 42 | ||
43 | struct rcu_dyntick_sched { | 43 | extern void rcu_qsctr_inc(int cpu); |
44 | int dynticks; | 44 | static inline void rcu_bh_qsctr_inc(int cpu) { } |
45 | int dynticks_snap; | ||
46 | int sched_qs; | ||
47 | int sched_qs_snap; | ||
48 | int sched_dynticks_snap; | ||
49 | }; | ||
50 | |||
51 | DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched); | ||
52 | |||
53 | static inline void rcu_qsctr_inc(int cpu) | ||
54 | { | ||
55 | struct rcu_dyntick_sched *rdssp = &per_cpu(rcu_dyntick_sched, cpu); | ||
56 | |||
57 | rdssp->sched_qs++; | ||
58 | } | ||
59 | #define rcu_bh_qsctr_inc(cpu) | ||
60 | 45 | ||
61 | /* | 46 | /* |
62 | * Someone might want to pass call_rcu_bh as a function pointer. | 47 | * Someone might want to pass call_rcu_bh as a function pointer. |
63 | * So this needs to just be a rename and not a macro function. | 48 | * So this needs to just be a rename and not a macro function. |
64 | * (no parentheses) | 49 | * (no parentheses) |
65 | */ | 50 | */ |
66 | #define call_rcu_bh call_rcu | 51 | #define call_rcu_bh call_rcu |
67 | 52 | ||
68 | /** | 53 | /** |
69 | * call_rcu_sched - Queue RCU callback for invocation after sched grace period. | 54 | * call_rcu_sched - Queue RCU callback for invocation after sched grace period. |
@@ -117,30 +102,12 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu); | |||
117 | struct softirq_action; | 102 | struct softirq_action; |
118 | 103 | ||
119 | #ifdef CONFIG_NO_HZ | 104 | #ifdef CONFIG_NO_HZ |
120 | 105 | extern void rcu_enter_nohz(void); | |
121 | static inline void rcu_enter_nohz(void) | 106 | extern void rcu_exit_nohz(void); |
122 | { | 107 | #else |
123 | static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); | 108 | # define rcu_enter_nohz() do { } while (0) |
124 | 109 | # define rcu_exit_nohz() do { } while (0) | |
125 | smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */ | 110 | #endif |
126 | __get_cpu_var(rcu_dyntick_sched).dynticks++; | ||
127 | WARN_ON_RATELIMIT(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1, &rs); | ||
128 | } | ||
129 | |||
130 | static inline void rcu_exit_nohz(void) | ||
131 | { | ||
132 | static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); | ||
133 | |||
134 | __get_cpu_var(rcu_dyntick_sched).dynticks++; | ||
135 | smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */ | ||
136 | WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1), | ||
137 | &rs); | ||
138 | } | ||
139 | |||
140 | #else /* CONFIG_NO_HZ */ | ||
141 | #define rcu_enter_nohz() do { } while (0) | ||
142 | #define rcu_exit_nohz() do { } while (0) | ||
143 | #endif /* CONFIG_NO_HZ */ | ||
144 | 111 | ||
145 | /* | 112 | /* |
146 | * A context switch is a grace period for rcupreempt synchronize_rcu() | 113 | * A context switch is a grace period for rcupreempt synchronize_rcu() |