path: root/kernel/smpboot.h
diff options
authorThomas Gleixner <>2012-07-16 10:42:36 +0000
committerThomas Gleixner <>2012-08-13 17:01:07 +0200
commitf97f8f06a49febbc3cb3635172efbe64ddc79700 (patch)
tree7917324eb3e1c36963a8c60c6a5601708b3ef208 /kernel/smpboot.h
parent2a1d446019f9a5983ec5a335b95e8593fdb6fa2e (diff)
smpboot: Provide infrastructure for percpu hotplug threads
Provide a generic interface for setting up and tearing down percpu threads. On registration the threads for already online cpus are created and started. On deregistration (modules) the threads are stoppped. During hotplug operations the threads are created, started, parked and unparked. The datastructure for registration provides a pointer to percpu storage space and optional setup, cleanup, park, unpark functions. These functions are called when the thread state changes. Each implementation has to provide a function which is queried and returns whether the thread should run and the thread function itself. The core code handles all state transitions and avoids duplicated code in the call sites. [ paulmck: Preemption leak fix ] Signed-off-by: Thomas Gleixner <> Cc: Peter Zijlstra <> Reviewed-by: Srivatsa S. Bhat <> Cc: Rusty Russell <> Reviewed-by: Paul E. McKenney <> Cc: Namhyung Kim <> Link: Signed-off-by: Thomas Gleixner <>
Diffstat (limited to 'kernel/smpboot.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/smpboot.h b/kernel/smpboot.h
index 6ef9433e1c70..72415a0eb955 100644
--- a/kernel/smpboot.h
+++ b/kernel/smpboot.h
@@ -13,4 +13,8 @@ static inline void idle_thread_set_boot_cpu(void) { }
static inline void idle_threads_init(void) { }
+int smpboot_create_threads(unsigned int cpu);
+void smpboot_park_threads(unsigned int cpu);
+void smpboot_unpark_threads(unsigned int cpu);