From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from www.linutronix.de ([62.245.132.108]:44747 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718Ab2DTNFy (ORCPT ); Fri, 20 Apr 2012 09:05:54 -0400 Message-ID: <20120420124557.448826362@linutronix.de> Date: Fri, 20 Apr 2012 13:05:50 -0000 From: Thomas Gleixner Subject: [patch 09/18] arm: Use generic idle thread allocation References: <20120420122120.097464672@linutronix.de> Content-Disposition: inline; filename=arm-use-generic-idle-thread-allocation.patch Sender: linux-arch-owner@vger.kernel.org List-ID: To: LKML Cc: linux-arch@vger.kernel.org, Peter Zijlstra , Rusty Russell , "Paul E. McKenney" , Ingo Molnar , "Srivatsa S. Bhat" , Russell King Message-ID: <20120420130550.dDsgRRSBg9A1yDRTm2Zw8hYZhdh7IV2f8FrRZRxyjHs@z> Signed-off-by: Thomas Gleixner Cc: Russell King --- arch/arm/Kconfig | 1 + arch/arm/include/asm/cpu.h | 1 - arch/arm/kernel/smp.c | 26 +------------------------- 3 files changed, 2 insertions(+), 26 deletions(-) Index: linux-2.6/arch/arm/Kconfig =================================================================== --- linux-2.6.orig/arch/arm/Kconfig +++ linux-2.6/arch/arm/Kconfig @@ -34,6 +34,7 @@ config ARM select CPU_PM if (SUSPEND || CPU_IDLE) select GENERIC_PCI_IOMAP select HAVE_BPF_JIT if NET + select GENERIC_SMP_IDLE_THREAD help The ARM series is a line of low-power-consumption RISC chip designs licensed by ARM Ltd and targeted at embedded applications and Index: linux-2.6/arch/arm/include/asm/cpu.h =================================================================== --- linux-2.6.orig/arch/arm/include/asm/cpu.h +++ linux-2.6/arch/arm/include/asm/cpu.h @@ -16,7 +16,6 @@ struct cpuinfo_arm { struct cpu cpu; #ifdef CONFIG_SMP - struct task_struct *idle; unsigned int loops_per_jiffy; #endif }; Index: linux-2.6/arch/arm/kernel/smp.c =================================================================== --- linux-2.6.orig/arch/arm/kernel/smp.c +++ linux-2.6/arch/arm/kernel/smp.c @@ -60,32 +60,11 @@ enum ipi_msg_type { static DECLARE_COMPLETION(cpu_running); -int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle) +int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *idle) { - struct cpuinfo_arm *ci = &per_cpu(cpu_data, cpu); - struct task_struct *idle = ci->idle; int ret; /* - * Spawn a new process manually, if not already done. - * Grab a pointer to its task struct so we can mess with it - */ - if (!idle) { - idle = fork_idle(cpu); - if (IS_ERR(idle)) { - printk(KERN_ERR "CPU%u: fork() failed\n", cpu); - return PTR_ERR(idle); - } - ci->idle = idle; - } else { - /* - * Since this idle thread is being re-used, call - * init_idle() to reinitialize the thread structure. - */ - init_idle(idle, cpu); - } - - /* * We need to tell the secondary core where to find * its stack and the page tables. */ @@ -318,9 +297,6 @@ void __init smp_cpus_done(unsigned int m void __init smp_prepare_boot_cpu(void) { - unsigned int cpu = smp_processor_id(); - - per_cpu(cpu_data, cpu).idle = current; } void __init smp_prepare_cpus(unsigned int max_cpus)