diff options
| -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 96cff2f8710b..14ec64fe175a 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c | |||
| @@ -171,12 +171,11 @@ EXPORT_SYMBOL(kthread_create); | |||
| 171 | */ | 171 | */ |
| 172 | void kthread_bind(struct task_struct *k, unsigned int cpu) | 172 | void kthread_bind(struct task_struct *k, unsigned int cpu) |
| 173 | { | 173 | { |
| 174 | if (k->state != TASK_UNINTERRUPTIBLE) { | 174 | /* Must have done schedule() in kthread() before we set_task_cpu */ |
| 175 | if (!wait_task_inactive(k, TASK_UNINTERRUPTIBLE)) { | ||
| 175 | WARN_ON(1); | 176 | WARN_ON(1); |
| 176 | return; | 177 | return; |
| 177 | } | 178 | } |
| 178 | /* Must have done schedule() in kthread() before we set_task_cpu */ | ||
| 179 | wait_task_inactive(k, 0); | ||
| 180 | set_task_cpu(k, cpu); | 179 | set_task_cpu(k, cpu); |
| 181 | k->cpus_allowed = cpumask_of_cpu(cpu); | 180 | k->cpus_allowed = cpumask_of_cpu(cpu); |
| 182 | k->rt.nr_cpus_allowed = 1; | 181 | k->rt.nr_cpus_allowed = 1; |
