path: root/kernel/smpboot.h
diff options
authorThomas Gleixner <>2012-04-20 13:05:45 +0000
committerThomas Gleixner <>2012-04-26 12:06:09 +0200
commit29d5e0476e1c4a513859e7858845ad172f560389 (patch)
treeb353eee6e4cdf57207e6eba5d80564a4e8811cc9 /kernel/smpboot.h
parent38498a67aa2cf8c80754b8d304bfacc10bc582b5 (diff)
smp: Provide generic idle thread allocation
All SMP architectures have magic to fork the idle task and to store it for reusage when cpu hotplug is enabled. Provide a generic infrastructure for it. Create/reinit the idle thread for the cpu which is brought up in the generic code and hand the thread pointer to the architecture code via __cpu_up(). Note, that fork_idle() is called via a workqueue, because this guarantees that the idle thread does not get a reference to a user space VM. This can happen when the boot process did not bring up all possible cpus and a later cpu_up() is initiated via the sysfs interface. In that case fork_idle() would be called in the context of the user space task and take a reference on the user space VM. Signed-off-by: Thomas Gleixner <> Cc: Peter Zijlstra <> Cc: Rusty Russell <> Cc: Paul E. McKenney <> Cc: Srivatsa S. Bhat <> Cc: Matt Turner <> Cc: Russell King <> Cc: Mike Frysinger <> Cc: Jesper Nilsson <> Cc: Richard Kuo <> Cc: Tony Luck <> Cc: Hirokazu Takata <> Cc: Ralf Baechle <> Cc: David Howells <> Cc: James E.J. Bottomley <> Cc: Benjamin Herrenschmidt <> Cc: Martin Schwidefsky <> Cc: Paul Mundt <> Cc: David S. Miller <> Cc: Chris Metcalf <> Cc: Richard Weinberger <> Cc: Acked-by: Venkatesh Pallipadi <> Link:
Diffstat (limited to 'kernel/smpboot.h')
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/smpboot.h b/kernel/smpboot.h
index d88e77165086..7943bbbab917 100644
--- a/kernel/smpboot.h
+++ b/kernel/smpboot.h
@@ -1,6 +1,16 @@
#ifndef SMPBOOT_H
#define SMPBOOT_H
+struct task_struct;
int smpboot_prepare(unsigned int cpu);
+struct task_struct *idle_thread_get(unsigned int cpu);
+void idle_thread_set_boot_cpu(void);
+static inline struct task_struct *idle_thread_get(unsigned int cpu) { return NULL; }
+static inline void idle_thread_set_boot_cpu(void) { }