X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=kernel%2Fsmpboot.c;h=4a5c6e73ecd41e7107a89b098f4eea9fefc647f1;hb=63ae602cea637ee4a6490d940c0da5d78bd0bbe0;hp=fc0d8270f69ed412947df06890f80602f68f6ff6;hpb=521f3970853a4b2ff7f833763532bdba2ea11257;p=cascardo%2Flinux.git diff --git a/kernel/smpboot.c b/kernel/smpboot.c index fc0d8270f69e..4a5c6e73ecd4 100644 --- a/kernel/smpboot.c +++ b/kernel/smpboot.c @@ -122,12 +122,12 @@ static int smpboot_thread_fn(void *data) if (kthread_should_park()) { __set_current_state(TASK_RUNNING); + preempt_enable(); if (ht->park && td->status == HP_THREAD_ACTIVE) { BUG_ON(td->cpu != smp_processor_id()); ht->park(td->cpu); td->status = HP_THREAD_PARKED; } - preempt_enable(); kthread_parkme(); /* We might have been woken for stop */ continue; @@ -186,6 +186,11 @@ __smpboot_create_thread(struct smp_hotplug_thread *ht, unsigned int cpu) kfree(td); return PTR_ERR(tsk); } + /* + * Park the thread so that it could start right on the CPU + * when it is available. + */ + kthread_park(tsk); get_task_struct(tsk); *per_cpu_ptr(ht->store, cpu) = tsk; if (ht->create) {