Skip to contentSkip to conversation

1/2 daemonize() calls reparent_to_init() cleanup

PATCH New Rusty Russell 1 participant 1 message Sep 4, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 1/2 daemonize() calls reparent_to_init() cleanup

Initialize child_reaper at idle thread entry: eg. ksoftirqd's PPID is 0, because it calls reparent_to_init() before child_reaper is initialized.

Name: Early child_reaper initialization
Author: Rusty Russell
Status: Trivial

D: This sets child_reaper to the idle thread upon creation, so that
D: ksoftirqd's reparent_to_init call doesn't get the swapper as parent.

init/main.c renamed from init/main.c.~1~ +10 -10
@@ -490,16 +493,6 @@
  */
 static void __init do_basic_setup(void)
 {
-	/*
-	 * Tell the world that we're going to be the grim
-	 * reaper of innocent orphaned children.
-	 *
-	 * We don't want people to have to make incorrect
-	 * assumptions about where in the task array this
-	 * can be found.
-	 */
-	child_reaper = current;
-
 #if defined(CONFIG_MTRR)	/* Do this after SMP initialization */
 /*
  * We should probably create some architecture-dependent "fixup after
@@ -545,6 +538,16 @@
 	static char * argv_sh[] = { "sh", NULL, };
 
 	lock_kernel();
+	/*
+	 * Tell the world that we're going to be the grim
+	 * reaper of innocent orphaned children.
+	 *
+	 * We don't want people to have to make incorrect
+	 * assumptions about where in the task array this
+	 * can be found.
+	 */
+	child_reaper = current;
+
 	/* Sets up cpus_possible() */
 	smp_prepare_cpus(max_cpus);
 

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.