diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2011-12-09 17:43:47 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-12-11 13:33:19 -0500 |
commit | 4f89b336fd1edf0c88875d0b7fcdc288c7de903d (patch) | |
tree | 8cadb7d4c326ad01ce7f0da55db8f03af17917e6 /kernel/rcutree_plugin.h | |
parent | 70321d447aa1a7cc2d60db16234f43c5a65630e7 (diff) |
rcu: Apply ACCESS_ONCE() to rcu_boost() return value
Both TINY_RCU's and TREE_RCU's implementations of rcu_boost() access
the ->boost_tasks and ->exp_tasks fields without preventing concurrent
changes to these fields. This commit therefore applies ACCESS_ONCE in
order to prevent compiler mischief.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree_plugin.h')
-rw-r--r-- | kernel/rcutree_plugin.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index f55f10ba01f5..8bb35d73e1f9 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -1232,7 +1232,8 @@ static int rcu_boost(struct rcu_node *rnp) | |||
1232 | rt_mutex_lock(&mtx); /* Side effect: boosts task t's priority. */ | 1232 | rt_mutex_lock(&mtx); /* Side effect: boosts task t's priority. */ |
1233 | rt_mutex_unlock(&mtx); /* Keep lockdep happy. */ | 1233 | rt_mutex_unlock(&mtx); /* Keep lockdep happy. */ |
1234 | 1234 | ||
1235 | return rnp->exp_tasks != NULL || rnp->boost_tasks != NULL; | 1235 | return ACCESS_ONCE(rnp->exp_tasks) != NULL || |
1236 | ACCESS_ONCE(rnp->boost_tasks) != NULL; | ||
1236 | } | 1237 | } |
1237 | 1238 | ||
1238 | /* | 1239 | /* |