]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - init/main.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[karo-tx-linux.git] / init / main.c
index 0ab82a453de50a647c32ea85fd4ee60ce7cc627f..f6204f712e7c639652d06cbefb70bba4df2ae7a1 100644 (file)
@@ -56,6 +56,7 @@
 #include <linux/debug_locks.h>
 #include <linux/debugobjects.h>
 #include <linux/lockdep.h>
+#include <linux/kmemleak.h>
 #include <linux/pid_namespace.h>
 #include <linux/device.h>
 #include <linux/kthread.h>
@@ -533,6 +534,21 @@ void __init __weak thread_info_cache_init(void)
 {
 }
 
+/*
+ * Set up kernel memory allocators
+ */
+static void __init mm_init(void)
+{
+       /*
+        * page_cgroup requires countinous pages as memmap
+        * and it's bigger than MAX_ORDER unless SPARSEMEM.
+        */
+       page_cgroup_init_flatmem();
+       mem_init();
+       kmem_cache_init();
+       vmalloc_init();
+}
+
 asmlinkage void __init start_kernel(void)
 {
        char * command_line;
@@ -587,15 +603,10 @@ asmlinkage void __init start_kernel(void)
         * kmem_cache_init()
         */
        pidhash_init();
-       vmalloc_init();
        vfs_caches_init_early();
        sort_main_extable();
        trap_init();
-       /*
-        * Set up kernel memory allocators
-        */
-       mem_init();
-       kmem_cache_init();
+       mm_init();
        /*
         * Set up the scheduler prior starting any interrupts (such as the
         * timer interrupt). Full topology setup happens at smp_init()
@@ -616,6 +627,7 @@ asmlinkage void __init start_kernel(void)
        /* init some links before init_ISA_irqs() */
        early_irq_init();
        init_IRQ();
+       prio_tree_init();
        init_timers();
        hrtimers_init();
        softirq_init();
@@ -628,6 +640,7 @@ asmlinkage void __init start_kernel(void)
                                 "enabled early\n");
        early_boot_irqs_on();
        local_irq_enable();
+       kmem_cache_init_late();
 
        /*
         * HACK ALERT! This is early. We're enabling the console before
@@ -662,6 +675,7 @@ asmlinkage void __init start_kernel(void)
        enable_debug_pagealloc();
        cpu_hotplug_init();
        kmemtrace_init();
+       kmemleak_init();
        debug_objects_mem_init();
        idr_init_cache();
        setup_per_cpu_pageset();
@@ -671,7 +685,6 @@ asmlinkage void __init start_kernel(void)
        calibrate_delay();
        pidmap_init();
        pgtable_cache_init();
-       prio_tree_init();
        anon_vma_init();
 #ifdef CONFIG_X86
        if (efi_enabled)