diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-08-10 16:55:03 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-09-23 10:42:50 -0400 |
commit | 115f7a7ca0d412aab81acaaaa95eb1ab1c622e2f (patch) | |
tree | 03efa7f9a3f796c88af60a8bf2cc7cdf2885000b | |
parent | b065a85354239cc96295f696eeace67ad3a55e5c (diff) |
rcu: Apply for_each_rcu_flavor() to increment_cpu_stall_ticks()
The increment_cpu_stall_ticks() function listed each RCU flavor
explicitly, with an ifdef to handle preemptible RCU. This commit
therefore applies for_each_rcu_flavor() to save a line of code.
Because this commit switches from a code-based enumeration of the
flavors of RCU to an rcu_state-list-based enumeration, it is no longer
possible to apply __get_cpu_var() to the per-CPU rcu_data structures.
We instead use __this_cpu_var() on the rcu_state structure's ->rda field
that references the corresponding rcu_data structures.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | kernel/rcutree_plugin.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index c47b28bf18ae..70b33bf780f0 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -2200,11 +2200,10 @@ static void zero_cpu_stall_ticks(struct rcu_data *rdp) | |||
2200 | /* Increment ->ticks_this_gp for all flavors of RCU. */ | 2200 | /* Increment ->ticks_this_gp for all flavors of RCU. */ |
2201 | static void increment_cpu_stall_ticks(void) | 2201 | static void increment_cpu_stall_ticks(void) |
2202 | { | 2202 | { |
2203 | __get_cpu_var(rcu_sched_data).ticks_this_gp++; | 2203 | struct rcu_state *rsp; |
2204 | __get_cpu_var(rcu_bh_data).ticks_this_gp++; | 2204 | |
2205 | #ifdef CONFIG_TREE_PREEMPT_RCU | 2205 | for_each_rcu_flavor(rsp) |
2206 | __get_cpu_var(rcu_preempt_data).ticks_this_gp++; | 2206 | __this_cpu_ptr(rsp->rda)->ticks_this_gp++; |
2207 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
2208 | } | 2207 | } |
2209 | 2208 | ||
2210 | #else /* #ifdef CONFIG_RCU_CPU_STALL_INFO */ | 2209 | #else /* #ifdef CONFIG_RCU_CPU_STALL_INFO */ |