Commit bd2f5536 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar

sched/rt: Use schedule_preempt_disabled()

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