Coccinelle based conversion. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/n/tip-24swm5zut3h9c4a6s46x8rws@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
@@ -239,9 +239,7 @@ void cpu_idle(void)
leds_event(led_idle_end);
rcu_idle_exit();
tick_nohz_idle_exit();
- preempt_enable_no_resched();
- schedule();
- preempt_disable();
+ schedule_preempt_disabled();
}
@@ -40,9 +40,7 @@ void cpu_idle(void)
cpu_idle_sleep();
@@ -94,9 +94,7 @@ void cpu_idle(void)
idle();
@@ -115,9 +115,7 @@ void cpu_idle (void)
idle = default_idle;
@@ -92,9 +92,7 @@ void cpu_idle(void)
@@ -81,9 +81,7 @@ void cpu_idle(void)
while (1) {
while (!need_resched())
@@ -330,9 +330,7 @@ cpu_idle (void)
normal_xtp();
#endif
check_pgt_cache();
if (cpu_is_offline(cpu))
play_dead();
@@ -90,9 +90,7 @@ void cpu_idle (void)
@@ -78,9 +78,7 @@ void cpu_idle(void)
@@ -73,9 +73,7 @@ void cpu_idle(void)
/* endless idle loop with no priority at all */
@@ -110,9 +110,7 @@ void cpu_idle(void)
@@ -80,9 +80,7 @@ void __noreturn cpu_idle(void)
@@ -123,9 +123,7 @@ void cpu_idle(void)
@@ -71,9 +71,7 @@ void cpu_idle(void)
barrier();
@@ -101,11 +101,11 @@ void cpu_idle(void)
ppc64_runlatch_on();
- if (cpu_should_die())
+ if (cpu_should_die()) {
+ preempt_enable_no_resched();
cpu_die();
+ }
@@ -584,9 +584,7 @@ static void iseries_shared_idle(void)
if (hvlpevent_is_pending())
process_iSeries_events();
@@ -615,9 +613,7 @@ static void iseries_dedicated_idle(void)
@@ -97,9 +97,7 @@ void cpu_idle(void)
if (test_thread_flag(TIF_MCCK_PENDING))
s390_handle_mcck();
@@ -53,9 +53,7 @@ void __noreturn cpu_idle(void)
@@ -114,9 +114,7 @@ void cpu_idle(void)
@@ -113,9 +113,7 @@ void cpu_idle(void)
cpu_relax();
@@ -138,9 +136,7 @@ void cpu_idle(void)
@@ -104,15 +104,13 @@ void cpu_idle(void)
-
#ifdef CONFIG_HOTPLUG_CPU
- if (cpu_is_offline(cpu))
+ if (cpu_is_offline(cpu)) {
cpu_play_dead();
@@ -108,9 +108,7 @@ void cpu_idle(void)
@@ -119,9 +119,7 @@ void cpu_idle(void)
@@ -156,9 +156,7 @@ void cpu_idle(void)
platform_idle();
@@ -374,11 +374,8 @@ static noinline void __init_refok rest_init(void)
* at least once to get things moving:
*/
init_idle_bootup_task(current);
/* Call into cpu_idle with preempt disabled */
cpu_idle();
@@ -240,9 +240,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
/* didn't get the lock, go to sleep: */
spin_unlock_mutex(&lock->wait_lock, flags);
spin_lock_mutex(&lock->wait_lock, flags);
@@ -744,9 +744,7 @@ static int run_ksoftirqd(void * __bind_cpu)
while (!kthread_should_stop()) {
preempt_disable();
if (!local_softirq_pending()) {
__set_current_state(TASK_RUNNING);