Commit 49717553 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

[PATCH] kernel thread idle fix

Now that init_idle does not remove tasks from the runqueue, those
architectures that use kernel_thread instead of copy_process for the idle
task will break.  To fix, ensure that CLONE_IDLETASK tasks are not put on
the runqueue in the first place.
Signed-off-by: default avatarNick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3632d86a
...@@ -1215,11 +1215,13 @@ long do_fork(unsigned long clone_flags, ...@@ -1215,11 +1215,13 @@ long do_fork(unsigned long clone_flags,
set_tsk_thread_flag(p, TIF_SIGPENDING); set_tsk_thread_flag(p, TIF_SIGPENDING);
} }
if (!(clone_flags & CLONE_STOPPED)) if (likely(!(clone_flags & CLONE_IDLETASK))) {
wake_up_new_task(p, clone_flags); if (!(clone_flags & CLONE_STOPPED))
else wake_up_new_task(p, clone_flags);
p->state = TASK_STOPPED; else
++total_forks; p->state = TASK_STOPPED;
++total_forks;
}
if (unlikely (trace)) { if (unlikely (trace)) {
current->ptrace_message = pid; current->ptrace_message = pid;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment