aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/smpboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/smpboot.c')
-rw-r--r--kernel/smpboot.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index b9bde5727829..02fc5c933673 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -131,7 +131,7 @@ static int smpboot_thread_fn(void *data)
131 continue; 131 continue;
132 } 132 }
133 133
134 //BUG_ON(td->cpu != smp_processor_id()); 134 BUG_ON(td->cpu != smp_processor_id());
135 135
136 /* Check for state change setup */ 136 /* Check for state change setup */
137 switch (td->status) { 137 switch (td->status) {
@@ -185,8 +185,18 @@ __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu)
185 } 185 }
186 get_task_struct(tsk); 186 get_task_struct(tsk);
187 *per_cpu_ptr(ht->store, cpu) = tsk; 187 *per_cpu_ptr(ht->store, cpu) = tsk;
188 if (ht->create) 188 if (ht->create) {
189 ht->create(cpu); 189 /*
190 * Make sure that the task has actually scheduled out
191 * into park position, before calling the create
192 * callback. At least the migration thread callback
193 * requires that the task is off the runqueue.
194 */
195 if (!wait_task_inactive(tsk, TASK_PARKED))
196 WARN_ON(1);
197 else
198 ht->create(cpu);
199 }
190 return 0; 200 return 0;
191} 201}
192 202
@@ -209,6 +219,8 @@ static void smpboot_unpark_thread(struct smp_hotplug_thread *ht, unsigned int cp
209{ 219{
210 struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu); 220 struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu);
211 221
222 if (ht->pre_unpark)
223 ht->pre_unpark(cpu);
212 kthread_unpark(tsk); 224 kthread_unpark(tsk);
213} 225}
214 226