aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/rcutree.c9
-rw-r--r--kernel/rcutree.h1
2 files changed, 5 insertions, 5 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 5929b021666d..ca7d1678ac79 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -158,7 +158,6 @@ unsigned long rcutorture_vernum;
158/* State information for rcu_barrier() and friends. */ 158/* State information for rcu_barrier() and friends. */
159 159
160static DEFINE_MUTEX(rcu_barrier_mutex); 160static DEFINE_MUTEX(rcu_barrier_mutex);
161static struct completion rcu_barrier_completion;
162 161
163/* 162/*
164 * Return true if an RCU grace period is in progress. The ACCESS_ONCE()s 163 * Return true if an RCU grace period is in progress. The ACCESS_ONCE()s
@@ -2275,7 +2274,7 @@ static void rcu_barrier_callback(struct rcu_head *rhp)
2275 struct rcu_state *rsp = rdp->rsp; 2274 struct rcu_state *rsp = rdp->rsp;
2276 2275
2277 if (atomic_dec_and_test(&rsp->barrier_cpu_count)) 2276 if (atomic_dec_and_test(&rsp->barrier_cpu_count))
2278 complete(&rcu_barrier_completion); 2277 complete(&rsp->barrier_completion);
2279} 2278}
2280 2279
2281/* 2280/*
@@ -2325,7 +2324,7 @@ static void _rcu_barrier(struct rcu_state *rsp)
2325 * 6. Both rcu_barrier_callback() callbacks are invoked, awakening 2324 * 6. Both rcu_barrier_callback() callbacks are invoked, awakening
2326 * us -- but before CPU 1's orphaned callbacks are invoked!!! 2325 * us -- but before CPU 1's orphaned callbacks are invoked!!!
2327 */ 2326 */
2328 init_completion(&rcu_barrier_completion); 2327 init_completion(&rsp->barrier_completion);
2329 atomic_set(&rsp->barrier_cpu_count, 1); 2328 atomic_set(&rsp->barrier_cpu_count, 1);
2330 raw_spin_lock_irqsave(&rsp->onofflock, flags); 2329 raw_spin_lock_irqsave(&rsp->onofflock, flags);
2331 rsp->rcu_barrier_in_progress = current; 2330 rsp->rcu_barrier_in_progress = current;
@@ -2375,10 +2374,10 @@ static void _rcu_barrier(struct rcu_state *rsp)
2375 * CPU, and thus each counted, remove the initial count. 2374 * CPU, and thus each counted, remove the initial count.
2376 */ 2375 */
2377 if (atomic_dec_and_test(&rsp->barrier_cpu_count)) 2376 if (atomic_dec_and_test(&rsp->barrier_cpu_count))
2378 complete(&rcu_barrier_completion); 2377 complete(&rsp->barrier_completion);
2379 2378
2380 /* Wait for all rcu_barrier_callback() callbacks to be invoked. */ 2379 /* Wait for all rcu_barrier_callback() callbacks to be invoked. */
2381 wait_for_completion(&rcu_barrier_completion); 2380 wait_for_completion(&rsp->barrier_completion);
2382 2381
2383 /* Other rcu_barrier() invocations can now safely proceed. */ 2382 /* Other rcu_barrier() invocations can now safely proceed. */
2384 mutex_unlock(&rcu_barrier_mutex); 2383 mutex_unlock(&rcu_barrier_mutex);
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
index c57ef0b7f097..d1ca4424122b 100644
--- a/kernel/rcutree.h
+++ b/kernel/rcutree.h
@@ -401,6 +401,7 @@ struct rcu_state {
401 /* Task doing rcu_barrier(), */ 401 /* Task doing rcu_barrier(), */
402 /* or NULL if no barrier. */ 402 /* or NULL if no barrier. */
403 atomic_t barrier_cpu_count; /* # CPUs waiting on. */ 403 atomic_t barrier_cpu_count; /* # CPUs waiting on. */
404 struct completion barrier_completion; /* Wake at barrier end. */
404 raw_spinlock_t fqslock; /* Only one task forcing */ 405 raw_spinlock_t fqslock; /* Only one task forcing */
405 /* quiescent states. */ 406 /* quiescent states. */
406 unsigned long jiffies_force_qs; /* Time at which to invoke */ 407 unsigned long jiffies_force_qs; /* Time at which to invoke */