nommu: ramfs: pages allocated to an inode's pagecache may get wrongly discarded
[safe/jmp/linux-2.6] / init / main.c
index 05b3132..83697e1 100644 (file)
@@ -62,6 +62,7 @@
 #include <linux/signal.h>
 #include <linux/idr.h>
 #include <linux/ftrace.h>
+#include <linux/async.h>
 #include <trace/boot.h>
 
 #include <asm/io.h>
@@ -96,7 +97,7 @@ static inline void mark_rodata_ro(void) { }
 extern void tc_init(void);
 #endif
 
-enum system_states system_state;
+enum system_states system_state __read_mostly;
 EXPORT_SYMBOL(system_state);
 
 /*
@@ -462,6 +463,7 @@ static noinline void __init_refok rest_init(void)
         * at least once to get things moving:
         */
        init_idle_bootup_task(current);
+       rcu_scheduler_starting();
        preempt_enable_no_resched();
        schedule();
        preempt_disable();
@@ -685,7 +687,7 @@ asmlinkage void __init start_kernel(void)
        rest_init();
 }
 
-static int initcall_debug;
+int initcall_debug;
 core_param(initcall_debug, initcall_debug, bool, 0644);
 
 int do_one_initcall(initcall_t fn)
@@ -786,6 +788,8 @@ static void run_init_process(char *init_filename)
  */
 static noinline int init_post(void)
 {
+       /* need to finish all async __init code before freeing the memory */
+       async_synchronize_full();
        free_initmem();
        unlock_kernel();
        mark_rodata_ro();