diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-01-31 07:11:12 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-02-14 09:29:37 -0500 |
commit | 7d7e499f7333f68b7e7f67d14b9c1480913b4afb (patch) | |
tree | 6924ef4eb2a08d7129dc1620d1a557e484df3680 /include/linux/smpboot.h | |
parent | 211b0cdc7dc574e5e756bdf1cc2f4a16b7f6e07e (diff) |
smpboot: Allow selfparking per cpu threads
The stop machine threads are still killed when a cpu goes offline. The
reason is that the thread is used to bring the cpu down, so it can't
be parked along with the other per cpu threads.
Allow a per cpu thread to be excluded from automatic parking, so it
can park itself once it's done
Add a create callback function as well.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Arjan van de Veen <arjan@infradead.org>
Cc: Paul Turner <pjt@google.com>
Cc: Richard Weinberger <rw@linutronix.de>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20130131120741.553993267@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/smpboot.h')
-rw-r--r-- | include/linux/smpboot.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/smpboot.h b/include/linux/smpboot.h index e0106d8581d3..c65dee059913 100644 --- a/include/linux/smpboot.h +++ b/include/linux/smpboot.h | |||
@@ -14,6 +14,8 @@ struct smpboot_thread_data; | |||
14 | * @thread_should_run: Check whether the thread should run or not. Called with | 14 | * @thread_should_run: Check whether the thread should run or not. Called with |
15 | * preemption disabled. | 15 | * preemption disabled. |
16 | * @thread_fn: The associated thread function | 16 | * @thread_fn: The associated thread function |
17 | * @create: Optional setup function, called when the thread gets | ||
18 | * created (Not called from the thread context) | ||
17 | * @setup: Optional setup function, called when the thread gets | 19 | * @setup: Optional setup function, called when the thread gets |
18 | * operational the first time | 20 | * operational the first time |
19 | * @cleanup: Optional cleanup function, called when the thread | 21 | * @cleanup: Optional cleanup function, called when the thread |
@@ -22,6 +24,7 @@ struct smpboot_thread_data; | |||
22 | * parked (cpu offline) | 24 | * parked (cpu offline) |
23 | * @unpark: Optional unpark function, called when the thread is | 25 | * @unpark: Optional unpark function, called when the thread is |
24 | * unparked (cpu online) | 26 | * unparked (cpu online) |
27 | * @selfparking: Thread is not parked by the park function. | ||
25 | * @thread_comm: The base name of the thread | 28 | * @thread_comm: The base name of the thread |
26 | */ | 29 | */ |
27 | struct smp_hotplug_thread { | 30 | struct smp_hotplug_thread { |
@@ -29,10 +32,12 @@ struct smp_hotplug_thread { | |||
29 | struct list_head list; | 32 | struct list_head list; |
30 | int (*thread_should_run)(unsigned int cpu); | 33 | int (*thread_should_run)(unsigned int cpu); |
31 | void (*thread_fn)(unsigned int cpu); | 34 | void (*thread_fn)(unsigned int cpu); |
35 | void (*create)(unsigned int cpu); | ||
32 | void (*setup)(unsigned int cpu); | 36 | void (*setup)(unsigned int cpu); |
33 | void (*cleanup)(unsigned int cpu, bool online); | 37 | void (*cleanup)(unsigned int cpu, bool online); |
34 | void (*park)(unsigned int cpu); | 38 | void (*park)(unsigned int cpu); |
35 | void (*unpark)(unsigned int cpu); | 39 | void (*unpark)(unsigned int cpu); |
40 | bool selfparking; | ||
36 | const char *thread_comm; | 41 | const char *thread_comm; |
37 | }; | 42 | }; |
38 | 43 | ||