From 49717553aec00cc22dd4917eb451e680c405b51b Mon Sep 17 00:00:00 2001 From: Nick Piggin Date: Mon, 23 Aug 2004 21:07:19 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/fork.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'kernel/fork.c') 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; -- cgit v1.2.3