summaryrefslogtreecommitdiffstats
path: root/kernel/rcutree_plugin.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paul.mckenney@linaro.org>2011-08-01 15:22:11 +0200
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2011-09-29 06:38:35 +0200
commit6206ab9bab620fc0fbbed30ce20d145b0b3d1840 (patch)
treeb57912ba9fff6f2deba89c0178d3122bbd1fda6e /kernel/rcutree_plugin.h
parentrcu: Improve rcu_assign_pointer() and RCU_INIT_POINTER() documentation (diff)
downloadlinux-6206ab9bab620fc0fbbed30ce20d145b0b3d1840.tar.xz
linux-6206ab9bab620fc0fbbed30ce20d145b0b3d1840.zip
rcu: Move __rcu_read_unlock()'s barrier() within if-statement
We only need to constrain the compiler if we are actually exiting the top-level RCU read-side critical section. This commit therefore moves the first barrier() cal in __rcu_read_unlock() to inside the "if" statement, thus avoiding needless register flushes for inner rcu_read_unlock() calls. 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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h
index 4bac5a29fb69..ed70f6bf4c31 100644
--- a/kernel/rcutree_plugin.h
+++ b/kernel/rcutree_plugin.h
@@ -415,10 +415,10 @@ void __rcu_read_unlock(void)
{
struct task_struct *t = current;
- barrier(); /* needed if we ever invoke rcu_read_unlock in rcutree.c */
if (t->rcu_read_lock_nesting != 1)
--t->rcu_read_lock_nesting;
else {
+ barrier(); /* critical section before exit code. */
t->rcu_read_lock_nesting = INT_MIN;
barrier(); /* assign before ->rcu_read_unlock_special load */
if (unlikely(ACCESS_ONCE(t->rcu_read_unlock_special)))