diff options
Diffstat (limited to 'init/main.c')
-rw-r--r-- | init/main.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/init/main.c b/init/main.c index 9d759d68d7a0..5616661eac01 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -534,6 +534,16 @@ void __init __weak thread_info_cache_init(void) | |||
534 | { | 534 | { |
535 | } | 535 | } |
536 | 536 | ||
537 | /* | ||
538 | * Set up kernel memory allocators | ||
539 | */ | ||
540 | static void __init mm_init(void) | ||
541 | { | ||
542 | mem_init(); | ||
543 | kmem_cache_init(); | ||
544 | vmalloc_init(); | ||
545 | } | ||
546 | |||
537 | asmlinkage void __init start_kernel(void) | 547 | asmlinkage void __init start_kernel(void) |
538 | { | 548 | { |
539 | char * command_line; | 549 | char * command_line; |
@@ -575,6 +585,23 @@ asmlinkage void __init start_kernel(void) | |||
575 | setup_nr_cpu_ids(); | 585 | setup_nr_cpu_ids(); |
576 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ | 586 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ |
577 | 587 | ||
588 | build_all_zonelists(); | ||
589 | page_alloc_init(); | ||
590 | |||
591 | printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); | ||
592 | parse_early_param(); | ||
593 | parse_args("Booting kernel", static_command_line, __start___param, | ||
594 | __stop___param - __start___param, | ||
595 | &unknown_bootoption); | ||
596 | /* | ||
597 | * These use large bootmem allocations and must precede | ||
598 | * kmem_cache_init() | ||
599 | */ | ||
600 | pidhash_init(); | ||
601 | vfs_caches_init_early(); | ||
602 | sort_main_extable(); | ||
603 | trap_init(); | ||
604 | mm_init(); | ||
578 | /* | 605 | /* |
579 | * Set up the scheduler prior starting any interrupts (such as the | 606 | * Set up the scheduler prior starting any interrupts (such as the |
580 | * timer interrupt). Full topology setup happens at smp_init() | 607 | * timer interrupt). Full topology setup happens at smp_init() |
@@ -586,26 +613,16 @@ asmlinkage void __init start_kernel(void) | |||
586 | * fragile until we cpu_idle() for the first time. | 613 | * fragile until we cpu_idle() for the first time. |
587 | */ | 614 | */ |
588 | preempt_disable(); | 615 | preempt_disable(); |
589 | build_all_zonelists(); | ||
590 | page_alloc_init(); | ||
591 | printk(KERN_NOTICE "Kernel command line: %s\n", boot_command_line); | ||
592 | parse_early_param(); | ||
593 | parse_args("Booting kernel", static_command_line, __start___param, | ||
594 | __stop___param - __start___param, | ||
595 | &unknown_bootoption); | ||
596 | if (!irqs_disabled()) { | 616 | if (!irqs_disabled()) { |
597 | printk(KERN_WARNING "start_kernel(): bug: interrupts were " | 617 | printk(KERN_WARNING "start_kernel(): bug: interrupts were " |
598 | "enabled *very* early, fixing it\n"); | 618 | "enabled *very* early, fixing it\n"); |
599 | local_irq_disable(); | 619 | local_irq_disable(); |
600 | } | 620 | } |
601 | sort_main_extable(); | ||
602 | trap_init(); | ||
603 | rcu_init(); | 621 | rcu_init(); |
604 | /* init some links before init_ISA_irqs() */ | 622 | /* init some links before init_ISA_irqs() */ |
605 | early_irq_init(); | 623 | early_irq_init(); |
606 | init_IRQ(); | 624 | init_IRQ(); |
607 | prio_tree_init(); | 625 | prio_tree_init(); |
608 | pidhash_init(); | ||
609 | init_timers(); | 626 | init_timers(); |
610 | hrtimers_init(); | 627 | hrtimers_init(); |
611 | softirq_init(); | 628 | softirq_init(); |
@@ -647,14 +664,10 @@ asmlinkage void __init start_kernel(void) | |||
647 | initrd_start = 0; | 664 | initrd_start = 0; |
648 | } | 665 | } |
649 | #endif | 666 | #endif |
650 | vmalloc_init(); | ||
651 | vfs_caches_init_early(); | ||
652 | cpuset_init_early(); | 667 | cpuset_init_early(); |
653 | page_cgroup_init(); | 668 | page_cgroup_init(); |
654 | mem_init(); | ||
655 | enable_debug_pagealloc(); | 669 | enable_debug_pagealloc(); |
656 | cpu_hotplug_init(); | 670 | cpu_hotplug_init(); |
657 | kmem_cache_init(); | ||
658 | kmemtrace_init(); | 671 | kmemtrace_init(); |
659 | kmemleak_init(); | 672 | kmemleak_init(); |
660 | debug_objects_mem_init(); | 673 | debug_objects_mem_init(); |