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