History

rcu: No interrupt disabling for rcu_prepare_for_idle()

The rcu_prepare_for_idle() function is always called with interrupts disabled, so there is no reason to disable interrupts again within rcu_prepare_for_idle(). Therefore, this commit removes all of the interrupt disabling, also removing a latent disabling-unbalance bug.

Paul E. McKenney committed 14 years ago

Commit c0cfbbb1 parent 3d3b7db1 file · +1 −17Browse files

Unified · Split

kernel/rcutree_plugin.h+1−17
@@ -2096,10 +2096,6 @@ static void rcu_cleanup_after_idle(int cpu) · 2095 unmodified lines
20962096 */
20972097 static void rcu_prepare_for_idle(int cpu)
20982098 {
2099− unsigned long flags;
2100−
2101− local_irq_save(flags);
2102−
21032099 /*
21042100 * If there are no callbacks on this CPU, enter dyntick-idle mode.
21052101 * Also reset state to avoid prejudicing later attempts.
@@ -2107,7 +2103,6 @@ static void rcu_prepare_for_idle(int cpu) · 1 unmodified line
21072103 if (!rcu_cpu_has_callbacks(cpu)) {
21082104 per_cpu(rcu_dyntick_holdoff, cpu) = jiffies - 1;
21092105 per_cpu(rcu_dyntick_drain, cpu) = 0;
2110− local_irq_restore(flags);
21112106 trace_rcu_prep_idle("No callbacks");
21122107 return;
21132108 }
@@ -2117,7 +2112,6 @@ static void rcu_prepare_for_idle(int cpu) · 3 unmodified lines
21172112 * refrained from disabling the scheduling-clock tick.
21182113 */
21192114 if (per_cpu(rcu_dyntick_holdoff, cpu) == jiffies) {
2120− local_irq_restore(flags);
21212115 trace_rcu_prep_idle("In holdoff");
21222116 return;
21232117 }
@@ -2142,7 +2136,6 @@ static void rcu_prepare_for_idle(int cpu) · 18 unmodified lines
21422136 } else if (--per_cpu(rcu_dyntick_drain, cpu) <= 0) {
21432137 /* We have hit the limit, so time to give up. */
21442138 per_cpu(rcu_dyntick_holdoff, cpu) = jiffies;
2145− local_irq_restore(flags);
21462139 trace_rcu_prep_idle("Begin holdoff");
21472140 invoke_rcu_core(); /* Force the CPU out of dyntick-idle. */
21482141 return;
@@ -2154,23 +2147,17 @@ static void rcu_prepare_for_idle(int cpu) · 5 unmodified lines
21542147 */
21552148 #ifdef CONFIG_TREE_PREEMPT_RCU
21562149 if (per_cpu(rcu_preempt_data, cpu).nxtlist) {
2157− local_irq_restore(flags);
21582150 rcu_preempt_qs(cpu);
21592151 force_quiescent_state(&rcu_preempt_state, 0);
2160− local_irq_save(flags);
21612152 }
21622153 #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */
21632154 if (per_cpu(rcu_sched_data, cpu).nxtlist) {
2164− local_irq_restore(flags);
21652155 rcu_sched_qs(cpu);
21662156 force_quiescent_state(&rcu_sched_state, 0);
2167− local_irq_save(flags);
21682157 }
21692158 if (per_cpu(rcu_bh_data, cpu).nxtlist) {
2170− local_irq_restore(flags);
21712159 rcu_bh_qs(cpu);
21722160 force_quiescent_state(&rcu_bh_state, 0);
2173− local_irq_save(flags);
21742161 }
21752162
21762163 /*
@@ -2178,13 +2165,10 @@ static void rcu_prepare_for_idle(int cpu) · 1 unmodified line
21782165 * So try forcing the callbacks through the grace period.
21792166 */
21802167 if (rcu_cpu_has_callbacks(cpu)) {
2181− local_irq_restore(flags);
21822168 trace_rcu_prep_idle("More callbacks");
21832169 invoke_rcu_core();
2184− } else {
2185− local_irq_restore(flags);
2170+ } else
21862171 trace_rcu_prep_idle("Callbacks drained");
2187− }
21882172 }
21892173
21902174 #endif /* #else #if !defined(CONFIG_RCU_FAST_NO_HZ) */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t