diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2014-10-29 18:39:39 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-01-06 14:02:39 -0500 |
commit | b08ea27d95bcaee6d9cf4edd64f373006661424a (patch) | |
tree | 0c2dd68df7898cc28804d0dc422961b0441e315f | |
parent | 734d16801349fbe951d2f780191d32c5b8a892d1 (diff) |
rcu: Protect rcu_boost() lockless accesses with ACCESS_ONCE()
This commit prevents random compiler optimizations by applying
ACCESS_ONCE() to lockless accesses.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | kernel/rcu/tree_plugin.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 3ec85cb5d544..d59913ef8360 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -1127,7 +1127,8 @@ static int rcu_boost(struct rcu_node *rnp) | |||
1127 | struct task_struct *t; | 1127 | struct task_struct *t; |
1128 | struct list_head *tb; | 1128 | struct list_head *tb; |
1129 | 1129 | ||
1130 | if (rnp->exp_tasks == NULL && rnp->boost_tasks == NULL) | 1130 | if (ACCESS_ONCE(rnp->exp_tasks) == NULL && |
1131 | ACCESS_ONCE(rnp->boost_tasks) == NULL) | ||
1131 | return 0; /* Nothing left to boost. */ | 1132 | return 0; /* Nothing left to boost. */ |
1132 | 1133 | ||
1133 | raw_spin_lock_irqsave(&rnp->lock, flags); | 1134 | raw_spin_lock_irqsave(&rnp->lock, flags); |