<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Nick Piggin &lt;nickpiggin@yahoo.com.au&gt;

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 &lt;nickpiggin@yahoo.com.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/kernel/fork.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff -puN kernel/fork.c~kernelthread-idle-fix-2 kernel/fork.c
--- 25/kernel/fork.c~kernelthread-idle-fix-2	2004-07-28 22:08:38.756139160 -0700
+++ 25-akpm/kernel/fork.c	2004-07-28 22:08:38.760138552 -0700
@@ -1214,11 +1214,13 @@ long do_fork(unsigned long clone_flags,
 			set_tsk_thread_flag(p, TIF_SIGPENDING);
 		}
 
-		if (!(clone_flags &amp; CLONE_STOPPED))
-			wake_up_new_task(p, clone_flags);
-		else
-			p-&gt;state = TASK_STOPPED;
-		++total_forks;
+		if (likely(!(clone_flags &amp; CLONE_IDLETASK))) {
+			if (!(clone_flags &amp; CLONE_STOPPED))
+				wake_up_new_task(p, clone_flags);
+			else
+				p-&gt;state = TASK_STOPPED;
+			++total_forks;
+		}
 
 		if (unlikely (trace)) {
 			current-&gt;ptrace_message = pid;
_
</pre></body></html>