Skip to content

Commit 52c0065

Browse files
committed
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>
1 parent 799fef0 commit 52c0065

File tree

4 files changed

+11
-30
lines changed

4 files changed

+11
-30
lines changed

arch/s390/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ config S390
9797
select CLONE_BACKWARDS2
9898
select GENERIC_CLOCKEVENTS
9999
select GENERIC_CPU_DEVICES if !SMP
100+
select GENERIC_IDLE_LOOP
100101
select GENERIC_KERNEL_THREAD
101102
select GENERIC_SMP_IDLE_THREAD
102103
select GENERIC_TIME_VSYSCALL_OLD

arch/s390/kernel/process.c

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,8 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
6161
return sf->gprs[8];
6262
}
6363

64-
/*
65-
* The idle loop on a S390...
66-
*/
67-
static void default_idle(void)
64+
void arch_cpu_idle(void)
6865
{
69-
if (cpu_is_offline(smp_processor_id()))
70-
cpu_die();
71-
local_irq_disable();
72-
if (need_resched()) {
73-
local_irq_enable();
74-
return;
75-
}
7666
local_mcck_disable();
7767
if (test_thread_flag(TIF_MCCK_PENDING)) {
7868
local_mcck_enable();
@@ -83,19 +73,15 @@ static void default_idle(void)
8373
vtime_stop_cpu();
8474
}
8575

86-
void cpu_idle(void)
76+
void arch_cpu_idle_exit(void)
8777
{
88-
for (;;) {
89-
tick_nohz_idle_enter();
90-
rcu_idle_enter();
91-
while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING))
92-
default_idle();
93-
rcu_idle_exit();
94-
tick_nohz_idle_exit();
95-
if (test_thread_flag(TIF_MCCK_PENDING))
96-
s390_handle_mcck();
97-
schedule_preempt_disabled();
98-
}
78+
if (test_thread_flag(TIF_MCCK_PENDING))
79+
s390_handle_mcck();
80+
}
81+
82+
void arch_cpu_idle_dead(void)
83+
{
84+
cpu_die();
9985
}
10086

10187
extern void __kprobes kernel_thread_starter(void);

arch/s390/kernel/smp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,7 @@ static void __cpuinit smp_start_secondary(void *cpuvoid)
711711
set_cpu_online(smp_processor_id(), true);
712712
inc_irq_stat(CPU_RST);
713713
local_irq_enable();
714-
/* cpu_idle will call schedule for us */
715-
cpu_idle();
714+
cpu_startup_entry(CPUHP_ONLINE);
716715
}
717716

718717
/* Upping and downing of CPUs */

arch/s390/kernel/vtime.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ void __kprobes vtime_stop_cpu(void)
158158
unsigned long psw_mask;
159159

160160
trace_hardirqs_on();
161-
/* Don't trace preempt off for idle. */
162-
stop_critical_timings();
163161

164162
/* Wait for external, I/O or machine check interrupt. */
165163
psw_mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_DAT |
@@ -169,9 +167,6 @@ void __kprobes vtime_stop_cpu(void)
169167
/* Call the assembler magic in entry.S */
170168
psw_idle(idle, psw_mask);
171169

172-
/* Reenable preemption tracer. */
173-
start_critical_timings();
174-
175170
/* Account time spent with enabled wait psw loaded as idle time. */
176171
idle->sequence++;
177172
smp_wmb();

0 commit comments

Comments
 (0)