Commit d8d03c0f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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.
parent c13b1e72
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment