diff options
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r-- | kernel/kthread.c | 5 |
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 | */ |
173 | void kthread_bind(struct task_struct *k, unsigned int cpu) | 173 | void 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; |