mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
7f8c125206
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 ] Change-Id: Ibd0993d9e7f95c47aee75836632b2cb950aa777c Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20120716103948.352501068@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
20 lines
576 B
C
20 lines
576 B
C
#ifndef SMPBOOT_H
|
|
#define SMPBOOT_H
|
|
|
|
struct task_struct;
|
|
|
|
#ifdef CONFIG_GENERIC_SMP_IDLE_THREAD
|
|
struct task_struct *idle_thread_get(unsigned int cpu);
|
|
void idle_thread_set_boot_cpu(void);
|
|
void idle_threads_init(void);
|
|
#else
|
|
static inline struct task_struct *idle_thread_get(unsigned int cpu) { return NULL; }
|
|
static inline void idle_thread_set_boot_cpu(void) { }
|
|
static inline void idle_threads_init(unsigned int cpu) { }
|
|
#endif
|
|
|
|
int smpboot_create_threads(unsigned int cpu);
|
|
void smpboot_park_threads(unsigned int cpu);
|
|
void smpboot_unpark_threads(unsigned int cpu);
|
|
|
|
#endif
|