diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-04-16 10:49:22 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-06-10 16:45:53 -0400 |
commit | 14961444696effb2e660fe876e5c1880f8bc3932 (patch) | |
tree | ab62688a54cd44215b2658dc89f644755215fa16 | |
parent | 2439b696cb5303f1eeb6aeebcee19e0056c3dd6e (diff) |
rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs
TINY_RCU's reset_cpu_stall_ticks() and check_cpu_stalls() functions
are defined unconditionally, and are empty functions if CONFIG_RCU_TRACE
is disabled (which in turns disables detection of RCU CPU stalls).
This commit saves a few lines of source code by defining these functions
only if CONFIG_RCU_TRACE=y.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | kernel/rcutiny.c | 4 | ||||
-rw-r--r-- | kernel/rcutiny_plugin.h | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c index 4adc9e26da34..aa344111de3e 100644 --- a/kernel/rcutiny.c +++ b/kernel/rcutiny.c | |||
@@ -204,7 +204,7 @@ static int rcu_is_cpu_rrupt_from_idle(void) | |||
204 | */ | 204 | */ |
205 | static int rcu_qsctr_help(struct rcu_ctrlblk *rcp) | 205 | static int rcu_qsctr_help(struct rcu_ctrlblk *rcp) |
206 | { | 206 | { |
207 | reset_cpu_stall_ticks(rcp); | 207 | RCU_TRACE(reset_cpu_stall_ticks(rcp)); |
208 | if (rcp->rcucblist != NULL && | 208 | if (rcp->rcucblist != NULL && |
209 | rcp->donetail != rcp->curtail) { | 209 | rcp->donetail != rcp->curtail) { |
210 | rcp->donetail = rcp->curtail; | 210 | rcp->donetail = rcp->curtail; |
@@ -251,7 +251,7 @@ void rcu_bh_qs(int cpu) | |||
251 | */ | 251 | */ |
252 | void rcu_check_callbacks(int cpu, int user) | 252 | void rcu_check_callbacks(int cpu, int user) |
253 | { | 253 | { |
254 | check_cpu_stalls(); | 254 | RCU_TRACE(check_cpu_stalls()); |
255 | if (user || rcu_is_cpu_rrupt_from_idle()) | 255 | if (user || rcu_is_cpu_rrupt_from_idle()) |
256 | rcu_sched_qs(cpu); | 256 | rcu_sched_qs(cpu); |
257 | else if (!in_softirq()) | 257 | else if (!in_softirq()) |
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h index 65ef1800f4fd..0cd385acccfa 100644 --- a/kernel/rcutiny_plugin.h +++ b/kernel/rcutiny_plugin.h | |||
@@ -158,15 +158,11 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp) | |||
158 | rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check(); | 158 | rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check(); |
159 | } | 159 | } |
160 | 160 | ||
161 | #endif /* #ifdef CONFIG_RCU_TRACE */ | ||
162 | |||
163 | static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp) | 161 | static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp) |
164 | { | 162 | { |
165 | #ifdef CONFIG_RCU_TRACE | ||
166 | rcp->ticks_this_gp = 0; | 163 | rcp->ticks_this_gp = 0; |
167 | rcp->gp_start = jiffies; | 164 | rcp->gp_start = jiffies; |
168 | rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check(); | 165 | rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check(); |
169 | #endif /* #ifdef CONFIG_RCU_TRACE */ | ||
170 | } | 166 | } |
171 | 167 | ||
172 | static void check_cpu_stalls(void) | 168 | static void check_cpu_stalls(void) |
@@ -174,3 +170,5 @@ static void check_cpu_stalls(void) | |||
174 | RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk)); | 170 | RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk)); |
175 | RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk)); | 171 | RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk)); |
176 | } | 172 | } |
173 | |||
174 | #endif /* #ifdef CONFIG_RCU_TRACE */ | ||