srcu: Fix bogus try_check_zero() comment
[linux-2.6-block.git] / kernel / rcu / tree_exp.h
index a7b639ccd46e0ade81946639ef1d50bdc2b68d21..027e123d93c728af62690ddc762927ab5c33514c 100644 (file)
@@ -331,6 +331,8 @@ static void sync_sched_exp_handler(void *data)
                return;
        }
        __this_cpu_write(rcu_sched_data.cpu_no_qs.b.exp, true);
+       /* Store .exp before .rcu_urgent_qs. */
+       smp_store_release(this_cpu_ptr(&rcu_dynticks.rcu_urgent_qs), true);
        resched_cpu(smp_processor_id());
 }
 
@@ -531,6 +533,7 @@ static void rcu_exp_wait_wake(struct rcu_state *rsp, unsigned long s)
                                rnp->exp_seq_rq = s;
                        spin_unlock(&rnp->exp_lock);
                }
+               smp_mb(); /* All above changes before wakeup. */
                wake_up_all(&rnp->exp_wq[(rsp->expedited_sequence >> 1) & 0x3]);
        }
        trace_rcu_exp_grace_period(rsp->name, s, TPS("endwake"));
@@ -612,6 +615,7 @@ static void _synchronize_rcu_expedited(struct rcu_state *rsp,
        wait_event(rnp->exp_wq[(s >> 1) & 0x3],
                   sync_exp_work_done(rsp,
                                      &rdp->exp_workdone0, s));
+       smp_mb(); /* Workqueue actions happen before return. */
 
        /* Let the next expedited grace period start. */
        mutex_unlock(&rsp->exp_mutex);
@@ -735,15 +739,3 @@ void synchronize_rcu_expedited(void)
 EXPORT_SYMBOL_GPL(synchronize_rcu_expedited);
 
 #endif /* #else #ifdef CONFIG_PREEMPT_RCU */
-
-/*
- * Switch to run-time mode once Tree RCU has fully initialized.
- */
-static int __init rcu_exp_runtime_mode(void)
-{
-       rcu_test_sync_prims();
-       rcu_scheduler_active = RCU_SCHEDULER_RUNNING;
-       rcu_test_sync_prims();
-       return 0;
-}
-core_initcall(rcu_exp_runtime_mode);