aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r--kernel/kthread.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 50598e29439a..8e7a7ce3ed0a 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -172,12 +172,11 @@ EXPORT_SYMBOL(kthread_create);
172 */ 172 */
173void kthread_bind(struct task_struct *k, unsigned int cpu) 173void kthread_bind(struct task_struct *k, unsigned int cpu)
174{ 174{
175 if (k->state != TASK_UNINTERRUPTIBLE) { 175 /* Must have done schedule() in kthread() before we set_task_cpu */
176 if (!wait_task_inactive(k, TASK_UNINTERRUPTIBLE)) {
176 WARN_ON(1); 177 WARN_ON(1);
177 return; 178 return;
178 } 179 }
179 /* Must have done schedule() in kthread() before we set_task_cpu */
180 wait_task_inactive(k, 0);
181 set_task_cpu(k, cpu); 180 set_task_cpu(k, cpu);
182 k->cpus_allowed = cpumask_of_cpu(cpu); 181 k->cpus_allowed = cpumask_of_cpu(cpu);
183 k->rt.nr_cpus_allowed = 1; 182 k->rt.nr_cpus_allowed = 1;