diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-04-20 09:05:50 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2012-04-26 06:06:11 -0400 |
commit | 84ec6d5796e095e2f8698bd2b5d33849ed26d9e2 (patch) | |
tree | 559f3072f2d1195ef1e02171f5e6429650a80792 /arch/arm | |
parent | 13583bf15eb1e890e03d46b6f2753e4b64af21c9 (diff) |
arm: 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>
Cc: Russell King <linux@arm.linux.org.uk>
Tested-by: Frank Rowand <frank.rowand@am.sony.com>
Link: http://lkml.kernel.org/r/20120420124557.448826362@linutronix.de
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/cpu.h | 1 | ||||
-rw-r--r-- | arch/arm/kernel/smp.c | 26 |
3 files changed, 2 insertions, 26 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index cf006d40342c..cb253ce218a0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -34,6 +34,7 @@ config ARM | |||
34 | select CPU_PM if (SUSPEND || CPU_IDLE) | 34 | select CPU_PM if (SUSPEND || CPU_IDLE) |
35 | select GENERIC_PCI_IOMAP | 35 | select GENERIC_PCI_IOMAP |
36 | select HAVE_BPF_JIT if NET | 36 | select HAVE_BPF_JIT if NET |
37 | select GENERIC_SMP_IDLE_THREAD | ||
37 | help | 38 | help |
38 | The ARM series is a line of low-power-consumption RISC chip designs | 39 | The ARM series is a line of low-power-consumption RISC chip designs |
39 | licensed by ARM Ltd and targeted at embedded applications and | 40 | licensed by ARM Ltd and targeted at embedded applications and |
diff --git a/arch/arm/include/asm/cpu.h b/arch/arm/include/asm/cpu.h index 793968173bef..d797223b39d5 100644 --- a/arch/arm/include/asm/cpu.h +++ b/arch/arm/include/asm/cpu.h | |||
@@ -16,7 +16,6 @@ | |||
16 | struct cpuinfo_arm { | 16 | struct cpuinfo_arm { |
17 | struct cpu cpu; | 17 | struct cpu cpu; |
18 | #ifdef CONFIG_SMP | 18 | #ifdef CONFIG_SMP |
19 | struct task_struct *idle; | ||
20 | unsigned int loops_per_jiffy; | 19 | unsigned int loops_per_jiffy; |
21 | #endif | 20 | #endif |
22 | }; | 21 | }; |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index f0e2cbbd837d..5e86f7c47824 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -60,32 +60,11 @@ enum ipi_msg_type { | |||
60 | 60 | ||
61 | static DECLARE_COMPLETION(cpu_running); | 61 | static DECLARE_COMPLETION(cpu_running); |
62 | 62 | ||
63 | int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) | 63 | int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) |
64 | { | 64 | { |
65 | struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu); | ||
66 | struct task_struct *idle = ci->idle; | ||
67 | int ret; | 65 | int ret; |
68 | 66 | ||
69 | /* | 67 | /* |
70 | * Spawn a new process manually, if not already done. | ||
71 | * Grab a pointer to its task struct so we can mess with it | ||
72 | */ | ||
73 | if (!idle) { | ||
74 | idle = fork_idle(cpu); | ||
75 | if (IS_ERR(idle)) { | ||
76 | printk(KERN_ERR "CPU%u: fork() failed\n", cpu); | ||
77 | return PTR_ERR(idle); | ||
78 | } | ||
79 | ci->idle = idle; | ||
80 | } else { | ||
81 | /* | ||
82 | * Since this idle thread is being re-used, call | ||
83 | * init_idle() to reinitialize the thread structure. | ||
84 | */ | ||
85 | init_idle(idle, cpu); | ||
86 | } | ||
87 | |||
88 | /* | ||
89 | * We need to tell the secondary core where to find | 68 | * We need to tell the secondary core where to find |
90 | * its stack and the page tables. | 69 | * its stack and the page tables. |
91 | */ | 70 | */ |
@@ -318,9 +297,6 @@ void __init smp_cpus_done(unsigned int max_cpus) | |||
318 | 297 | ||
319 | void __init smp_prepare_boot_cpu(void) | 298 | void __init smp_prepare_boot_cpu(void) |
320 | { | 299 | { |
321 | unsigned int cpu = smp_processor_id(); | ||
322 | |||
323 | per_cpu(cpu_data, cpu).idle = current; | ||
324 | } | 300 | } |
325 | 301 | ||
326 | void __init smp_prepare_cpus(unsigned int max_cpus) | 302 | void __init smp_prepare_cpus(unsigned int max_cpus) |