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.
Unified · Split
| @@ -2096,10 +2096,6 @@ static void rcu_cleanup_after_idle(int cpu) · 2095 unmodified lines | ||
| 2096 | 2096 | */ |
| 2097 | 2097 | static void rcu_prepare_for_idle(int cpu) |
| 2098 | 2098 | { |
| 2099 | − unsigned long flags; | |
| 2100 | − | |
| 2101 | − local_irq_save(flags); | |
| 2102 | − | |
| 2103 | 2099 | /* |
| 2104 | 2100 | * If there are no callbacks on this CPU, enter dyntick-idle mode. |
| 2105 | 2101 | * Also reset state to avoid prejudicing later attempts. |
| @@ -2107,7 +2103,6 @@ static void rcu_prepare_for_idle(int cpu) · 1 unmodified line | ||
| 2107 | 2103 | if (!rcu_cpu_has_callbacks(cpu)) { |
| 2108 | 2104 | per_cpu(rcu_dyntick_holdoff, cpu) = jiffies - 1; |
| 2109 | 2105 | per_cpu(rcu_dyntick_drain, cpu) = 0; |
| 2110 | − local_irq_restore(flags); | |
| 2111 | 2106 | trace_rcu_prep_idle("No callbacks"); |
| 2112 | 2107 | return; |
| 2113 | 2108 | } |
| @@ -2117,7 +2112,6 @@ static void rcu_prepare_for_idle(int cpu) · 3 unmodified lines | ||
| 2117 | 2112 | * refrained from disabling the scheduling-clock tick. |
| 2118 | 2113 | */ |
| 2119 | 2114 | if (per_cpu(rcu_dyntick_holdoff, cpu) == jiffies) { |
| 2120 | − local_irq_restore(flags); | |
| 2121 | 2115 | trace_rcu_prep_idle("In holdoff"); |
| 2122 | 2116 | return; |
| 2123 | 2117 | } |
| @@ -2142,7 +2136,6 @@ static void rcu_prepare_for_idle(int cpu) · 18 unmodified lines | ||
| 2142 | 2136 | } else if (--per_cpu(rcu_dyntick_drain, cpu) <= 0) { |
| 2143 | 2137 | /* We have hit the limit, so time to give up. */ |
| 2144 | 2138 | per_cpu(rcu_dyntick_holdoff, cpu) = jiffies; |
| 2145 | − local_irq_restore(flags); | |
| 2146 | 2139 | trace_rcu_prep_idle("Begin holdoff"); |
| 2147 | 2140 | invoke_rcu_core(); /* Force the CPU out of dyntick-idle. */ |
| 2148 | 2141 | return; |
| @@ -2154,23 +2147,17 @@ static void rcu_prepare_for_idle(int cpu) · 5 unmodified lines | ||
| 2154 | 2147 | */ |
| 2155 | 2148 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 2156 | 2149 | if (per_cpu(rcu_preempt_data, cpu).nxtlist) { |
| 2157 | − local_irq_restore(flags); | |
| 2158 | 2150 | rcu_preempt_qs(cpu); |
| 2159 | 2151 | force_quiescent_state(&rcu_preempt_state, 0); |
| 2160 | − local_irq_save(flags); | |
| 2161 | 2152 | } |
| 2162 | 2153 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
| 2163 | 2154 | if (per_cpu(rcu_sched_data, cpu).nxtlist) { |
| 2164 | − local_irq_restore(flags); | |
| 2165 | 2155 | rcu_sched_qs(cpu); |
| 2166 | 2156 | force_quiescent_state(&rcu_sched_state, 0); |
| 2167 | − local_irq_save(flags); | |
| 2168 | 2157 | } |
| 2169 | 2158 | if (per_cpu(rcu_bh_data, cpu).nxtlist) { |
| 2170 | − local_irq_restore(flags); | |
| 2171 | 2159 | rcu_bh_qs(cpu); |
| 2172 | 2160 | force_quiescent_state(&rcu_bh_state, 0); |
| 2173 | − local_irq_save(flags); | |
| 2174 | 2161 | } |
| 2175 | 2162 | |
| 2176 | 2163 | /* |
| @@ -2178,13 +2165,10 @@ static void rcu_prepare_for_idle(int cpu) · 1 unmodified line | ||
| 2178 | 2165 | * So try forcing the callbacks through the grace period. |
| 2179 | 2166 | */ |
| 2180 | 2167 | if (rcu_cpu_has_callbacks(cpu)) { |
| 2181 | − local_irq_restore(flags); | |
| 2182 | 2168 | trace_rcu_prep_idle("More callbacks"); |
| 2183 | 2169 | invoke_rcu_core(); |
| 2184 | − } else { | |
| 2185 | − local_irq_restore(flags); | |
| 2170 | + } else | |
| 2186 | 2171 | trace_rcu_prep_idle("Callbacks drained"); |
| 2187 | − } | |
| 2188 | 2172 | } |
| 2189 | 2173 | |
| 2190 | 2174 | #endif /* #else #if !defined(CONFIG_RCU_FAST_NO_HZ) */ |