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); ...@@ -89,6 +89,7 @@ extern void radix_tree_init(void);
extern void free_initmem(void); extern void free_initmem(void);
extern void populate_rootfs(void); extern void populate_rootfs(void);
extern void driver_init(void); extern void driver_init(void);
extern void prepare_namespace(void);
#ifdef CONFIG_TC #ifdef CONFIG_TC
extern void tc_init(void); extern void tc_init(void);
...@@ -471,7 +472,6 @@ asmlinkage void __init start_kernel(void) ...@@ -471,7 +472,6 @@ asmlinkage void __init start_kernel(void)
signals_init(); signals_init();
/* rootfs populating might need page-writeback */ /* rootfs populating might need page-writeback */
page_writeback_init(); page_writeback_init();
populate_rootfs();
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
proc_root_init(); proc_root_init();
#endif #endif
...@@ -577,8 +577,6 @@ static void run_init_process(char *init_filename) ...@@ -577,8 +577,6 @@ static void run_init_process(char *init_filename)
execve(init_filename, argv_init, envp_init); execve(init_filename, argv_init, envp_init);
} }
extern void prepare_namespace(void);
static int init(void * unused) static int init(void * unused)
{ {
lock_kernel(); lock_kernel();
...@@ -600,14 +598,15 @@ static int init(void * unused) ...@@ -600,14 +598,15 @@ static int init(void * unused)
smp_init(); smp_init();
do_basic_setup(); do_basic_setup();
/* populate_rootfs();
* check if there is an early userspace init, if yes /*
* let it do all the work * 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"; if (sys_access("/init", 0) == 0)
else execute_command = "/init";
prepare_namespace(); else
prepare_namespace();
/* /*
* Ok, we have completed the initial bootup, and * 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