X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=kernel%2Fkthread.c;h=4fbc456f393d0b1fb328667d9e93cc214c39da06;hb=0c2a498fa6d33d8ca9c8a0c29039c41e1734cb9e;hp=50598e29439a07c3b3acbb318514efa377a44e33;hpb=0a16b6075843325dc402edf80c1662838b929aff;p=safe%2Fjmp%2Flinux-2.6 diff --git a/kernel/kthread.c b/kernel/kthread.c index 50598e29..4fbc456 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -21,6 +21,9 @@ static DEFINE_SPINLOCK(kthread_create_lock); static LIST_HEAD(kthread_create_list); struct task_struct *kthreadd_task; +DEFINE_TRACE(sched_kthread_stop); +DEFINE_TRACE(sched_kthread_stop_ret); + struct kthread_create_info { /* Information passed to kthread() from kthreadd. */ @@ -172,12 +175,11 @@ EXPORT_SYMBOL(kthread_create); */ void kthread_bind(struct task_struct *k, unsigned int cpu) { - if (k->state != TASK_UNINTERRUPTIBLE) { + /* Must have done schedule() in kthread() before we set_task_cpu */ + if (!wait_task_inactive(k, TASK_UNINTERRUPTIBLE)) { WARN_ON(1); return; } - /* Must have done schedule() in kthread() before we set_task_cpu */ - wait_task_inactive(k, 0); set_task_cpu(k, cpu); k->cpus_allowed = cpumask_of_cpu(cpu); k->rt.nr_cpus_allowed = 1;