mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
s390: Use generic idle loop
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Paul McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Cc: Magnus Damm <magnus.damm@gmail.com> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> Link: http://lkml.kernel.org/r/20130321215235.090816526@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
799fef0612
commit
52c0065947
@ -97,6 +97,7 @@ config S390
|
|||||||
select CLONE_BACKWARDS2
|
select CLONE_BACKWARDS2
|
||||||
select GENERIC_CLOCKEVENTS
|
select GENERIC_CLOCKEVENTS
|
||||||
select GENERIC_CPU_DEVICES if !SMP
|
select GENERIC_CPU_DEVICES if !SMP
|
||||||
|
select GENERIC_IDLE_LOOP
|
||||||
select GENERIC_KERNEL_THREAD
|
select GENERIC_KERNEL_THREAD
|
||||||
select GENERIC_SMP_IDLE_THREAD
|
select GENERIC_SMP_IDLE_THREAD
|
||||||
select GENERIC_TIME_VSYSCALL_OLD
|
select GENERIC_TIME_VSYSCALL_OLD
|
||||||
|
@ -61,18 +61,8 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
|
|||||||
return sf->gprs[8];
|
return sf->gprs[8];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
void arch_cpu_idle(void)
|
||||||
* The idle loop on a S390...
|
|
||||||
*/
|
|
||||||
static void default_idle(void)
|
|
||||||
{
|
{
|
||||||
if (cpu_is_offline(smp_processor_id()))
|
|
||||||
cpu_die();
|
|
||||||
local_irq_disable();
|
|
||||||
if (need_resched()) {
|
|
||||||
local_irq_enable();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
local_mcck_disable();
|
local_mcck_disable();
|
||||||
if (test_thread_flag(TIF_MCCK_PENDING)) {
|
if (test_thread_flag(TIF_MCCK_PENDING)) {
|
||||||
local_mcck_enable();
|
local_mcck_enable();
|
||||||
@ -83,19 +73,15 @@ static void default_idle(void)
|
|||||||
vtime_stop_cpu();
|
vtime_stop_cpu();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu_idle(void)
|
void arch_cpu_idle_exit(void)
|
||||||
{
|
{
|
||||||
for (;;) {
|
if (test_thread_flag(TIF_MCCK_PENDING))
|
||||||
tick_nohz_idle_enter();
|
s390_handle_mcck();
|
||||||
rcu_idle_enter();
|
}
|
||||||
while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING))
|
|
||||||
default_idle();
|
void arch_cpu_idle_dead(void)
|
||||||
rcu_idle_exit();
|
{
|
||||||
tick_nohz_idle_exit();
|
cpu_die();
|
||||||
if (test_thread_flag(TIF_MCCK_PENDING))
|
|
||||||
s390_handle_mcck();
|
|
||||||
schedule_preempt_disabled();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void __kprobes kernel_thread_starter(void);
|
extern void __kprobes kernel_thread_starter(void);
|
||||||
|
@ -711,8 +711,7 @@ static void __cpuinit smp_start_secondary(void *cpuvoid)
|
|||||||
set_cpu_online(smp_processor_id(), true);
|
set_cpu_online(smp_processor_id(), true);
|
||||||
inc_irq_stat(CPU_RST);
|
inc_irq_stat(CPU_RST);
|
||||||
local_irq_enable();
|
local_irq_enable();
|
||||||
/* cpu_idle will call schedule for us */
|
cpu_startup_entry(CPUHP_ONLINE);
|
||||||
cpu_idle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Upping and downing of CPUs */
|
/* Upping and downing of CPUs */
|
||||||
|
@ -158,8 +158,6 @@ void __kprobes vtime_stop_cpu(void)
|
|||||||
unsigned long psw_mask;
|
unsigned long psw_mask;
|
||||||
|
|
||||||
trace_hardirqs_on();
|
trace_hardirqs_on();
|
||||||
/* Don't trace preempt off for idle. */
|
|
||||||
stop_critical_timings();
|
|
||||||
|
|
||||||
/* Wait for external, I/O or machine check interrupt. */
|
/* Wait for external, I/O or machine check interrupt. */
|
||||||
psw_mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_DAT |
|
psw_mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_DAT |
|
||||||
@ -169,9 +167,6 @@ void __kprobes vtime_stop_cpu(void)
|
|||||||
/* Call the assembler magic in entry.S */
|
/* Call the assembler magic in entry.S */
|
||||||
psw_idle(idle, psw_mask);
|
psw_idle(idle, psw_mask);
|
||||||
|
|
||||||
/* Reenable preemption tracer. */
|
|
||||||
start_critical_timings();
|
|
||||||
|
|
||||||
/* Account time spent with enabled wait psw loaded as idle time. */
|
/* Account time spent with enabled wait psw loaded as idle time. */
|
||||||
idle->sequence++;
|
idle->sequence++;
|
||||||
smp_wmb();
|
smp_wmb();
|
||||||
|
Loading…
Reference in New Issue
Block a user