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 /kernel/smpboot.c | |
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 'kernel/smpboot.c')
-rw-r--r-- | kernel/smpboot.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/smpboot.c b/kernel/smpboot.c index d6c5fc054242..d4abac261779 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c | |||
@@ -183,9 +183,10 @@ __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu) | |||
183 | kfree(td); | 183 | kfree(td); |
184 | return PTR_ERR(tsk); | 184 | return PTR_ERR(tsk); |
185 | } | 185 | } |
186 | |||
187 | get_task_struct(tsk); | 186 | get_task_struct(tsk); |
188 | *per_cpu_ptr(ht->store, cpu) = tsk; | 187 | *per_cpu_ptr(ht->store, cpu) = tsk; |
188 | if (ht->create) | ||
189 | ht->create(cpu); | ||
189 | return 0; | 190 | return 0; |
190 | } | 191 | } |
191 | 192 | ||
@@ -225,7 +226,7 @@ static void smpboot_park_thread(struct smp_hotplug_thread *ht, unsigned int cpu) | |||
225 | { | 226 | { |
226 | struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu); | 227 | struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu); |
227 | 228 | ||
228 | if (tsk) | 229 | if (tsk && !ht->selfparking) |
229 | kthread_park(tsk); | 230 | kthread_park(tsk); |
230 | } | 231 | } |
231 | 232 | ||