s390: Use generic idle thread allocation
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Link: http://lkml.kernel.org/r/20120420124557.652574928@linutronix.de
This commit is contained in:
Родитель
3b0132ce4f
Коммит
e80e7813cd
|
@ -122,6 +122,7 @@ config S390
|
||||||
select ARCH_INLINE_WRITE_UNLOCK_BH
|
select ARCH_INLINE_WRITE_UNLOCK_BH
|
||||||
select ARCH_INLINE_WRITE_UNLOCK_IRQ
|
select ARCH_INLINE_WRITE_UNLOCK_IRQ
|
||||||
select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
|
select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
|
||||||
|
select GENERIC_SMP_IDLE_THREAD
|
||||||
|
|
||||||
config SCHED_OMIT_FRAME_POINTER
|
config SCHED_OMIT_FRAME_POINTER
|
||||||
def_bool y
|
def_bool y
|
||||||
|
|
|
@ -85,7 +85,6 @@ enum {
|
||||||
|
|
||||||
struct pcpu {
|
struct pcpu {
|
||||||
struct cpu cpu;
|
struct cpu cpu;
|
||||||
struct task_struct *idle; /* idle process for the cpu */
|
|
||||||
struct _lowcore *lowcore; /* lowcore page(s) for the cpu */
|
struct _lowcore *lowcore; /* lowcore page(s) for the cpu */
|
||||||
unsigned long async_stack; /* async stack for the cpu */
|
unsigned long async_stack; /* async stack for the cpu */
|
||||||
unsigned long panic_stack; /* panic stack for the cpu */
|
unsigned long panic_stack; /* panic stack for the cpu */
|
||||||
|
@ -721,26 +720,9 @@ static void __cpuinit smp_start_secondary(void *cpuvoid)
|
||||||
cpu_idle();
|
cpu_idle();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct create_idle {
|
|
||||||
struct work_struct work;
|
|
||||||
struct task_struct *idle;
|
|
||||||
struct completion done;
|
|
||||||
int cpu;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void __cpuinit smp_fork_idle(struct work_struct *work)
|
|
||||||
{
|
|
||||||
struct create_idle *c_idle;
|
|
||||||
|
|
||||||
c_idle = container_of(work, struct create_idle, work);
|
|
||||||
c_idle->idle = fork_idle(c_idle->cpu);
|
|
||||||
complete(&c_idle->done);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Upping and downing of CPUs */
|
/* Upping and downing of CPUs */
|
||||||
int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
|
int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
|
||||||
{
|
{
|
||||||
struct create_idle c_idle;
|
|
||||||
struct pcpu *pcpu;
|
struct pcpu *pcpu;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -750,22 +732,12 @@ int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
|
||||||
if (pcpu_sigp_retry(pcpu, sigp_initial_cpu_reset, 0) !=
|
if (pcpu_sigp_retry(pcpu, sigp_initial_cpu_reset, 0) !=
|
||||||
sigp_order_code_accepted)
|
sigp_order_code_accepted)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
if (!pcpu->idle) {
|
|
||||||
c_idle.done = COMPLETION_INITIALIZER_ONSTACK(c_idle.done);
|
|
||||||
INIT_WORK_ONSTACK(&c_idle.work, smp_fork_idle);
|
|
||||||
c_idle.cpu = cpu;
|
|
||||||
schedule_work(&c_idle.work);
|
|
||||||
wait_for_completion(&c_idle.done);
|
|
||||||
if (IS_ERR(c_idle.idle))
|
|
||||||
return PTR_ERR(c_idle.idle);
|
|
||||||
pcpu->idle = c_idle.idle;
|
|
||||||
}
|
|
||||||
init_idle(pcpu->idle, cpu);
|
|
||||||
rc = pcpu_alloc_lowcore(pcpu, cpu);
|
rc = pcpu_alloc_lowcore(pcpu, cpu);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
pcpu_prepare_secondary(pcpu, cpu);
|
pcpu_prepare_secondary(pcpu, cpu);
|
||||||
pcpu_attach_task(pcpu, pcpu->idle);
|
pcpu_attach_task(pcpu, tidle);
|
||||||
pcpu_start_fn(pcpu, smp_start_secondary, NULL);
|
pcpu_start_fn(pcpu, smp_start_secondary, NULL);
|
||||||
while (!cpu_online(cpu))
|
while (!cpu_online(cpu))
|
||||||
cpu_relax();
|
cpu_relax();
|
||||||
|
@ -852,7 +824,6 @@ void __init smp_prepare_boot_cpu(void)
|
||||||
struct pcpu *pcpu = pcpu_devices;
|
struct pcpu *pcpu = pcpu_devices;
|
||||||
|
|
||||||
boot_cpu_address = stap();
|
boot_cpu_address = stap();
|
||||||
pcpu->idle = current;
|
|
||||||
pcpu->state = CPU_STATE_CONFIGURED;
|
pcpu->state = CPU_STATE_CONFIGURED;
|
||||||
pcpu->address = boot_cpu_address;
|
pcpu->address = boot_cpu_address;
|
||||||
pcpu->lowcore = (struct _lowcore *)(unsigned long) store_prefix();
|
pcpu->lowcore = (struct _lowcore *)(unsigned long) store_prefix();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче