aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-20 17:42:18 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-20 17:42:18 -0700
commitd8d03c0fd974d03201505fd359ee9f3b03a1220b (patch)
tree62924aca6610e6a1495c5aab2594acd92b34828d /init
parentc13b1e723329b828f1a7904625fcecc0c22307be (diff)
downloadhistory-d8d03c0fd974d03201505fd359ee9f3b03a1220b.tar.gz
[PATCH] Call populate_rootfs later in boot
populate_rootfs() is called rather early - before we've called init_idle(). But populate_rootfs() does file I/O, which involves calls to cond_resched(), and downing of semaphores, etc. If it scheules, the scheduler emits scheduling-while-atomic warnings and sometimes oopses. So run populate_rootfs() later, after the scheduler is all set up.
Diffstat (limited to 'init')
-rw-r--r--init/main.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/init/main.c b/init/main.c
index c500c6fe296df2..84cf96dddf4e6c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -89,6 +89,7 @@ extern void radix_tree_init(void);
extern void free_initmem(void);
extern void populate_rootfs(void);
extern void driver_init(void);
+extern void prepare_namespace(void);
#ifdef CONFIG_TC
extern void tc_init(void);
@@ -471,7 +472,6 @@ asmlinkage void __init start_kernel(void)
signals_init();
/* rootfs populating might need page-writeback */
page_writeback_init();
- populate_rootfs();
#ifdef CONFIG_PROC_FS
proc_root_init();
#endif
@@ -577,8 +577,6 @@ static void run_init_process(char *init_filename)
execve(init_filename, argv_init, envp_init);
}
-extern void prepare_namespace(void);
-
static int init(void * unused)
{
lock_kernel();
@@ -600,14 +598,15 @@ static int init(void * unused)
smp_init();
do_basic_setup();
- /*
- * check if there is an early userspace init, if yes
- * let it do all the work
- */
- if (sys_access("/init", 0) == 0)
- execute_command = "/init";
- else
- prepare_namespace();
+ populate_rootfs();
+ /*
+ * check if there is an early userspace init. If yes, let it do all
+ * the work
+ */
+ if (sys_access("/init", 0) == 0)
+ execute_command = "/init";
+ else
+ prepare_namespace();
/*
* Ok, we have completed the initial bootup, and