summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2004-08-23 21:07:19 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-23 21:07:19 -0700
commit49717553aec00cc22dd4917eb451e680c405b51b (patch)
treeffa6ae8ea177f2472d7a911ac11aa50db56301f0 /kernel/fork.c
parent3632d86ab3f9badaf2b2cdc26e58a8b9be59939f (diff)
[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: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 88a2712c7273..bf522f2f33ca 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1215,11 +1215,13 @@ long do_fork(unsigned long clone_flags,
set_tsk_thread_flag(p, TIF_SIGPENDING);
}
- if (!(clone_flags & CLONE_STOPPED))
- wake_up_new_task(p, clone_flags);
- else
- p->state = TASK_STOPPED;
- ++total_forks;
+ if (likely(!(clone_flags & CLONE_IDLETASK))) {
+ if (!(clone_flags & CLONE_STOPPED))
+ wake_up_new_task(p, clone_flags);
+ else
+ p->state = TASK_STOPPED;
+ ++total_forks;
+ }
if (unlikely (trace)) {
current->ptrace_message = pid;