X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=init%2Fmain.c;h=f7fb20021d48d5a4a175cc79d84f6b3cfb9eab53;hb=a19214430d27a3af6f1672ec26f3c893ef899ede;hp=624266b524d41e98c7012a2b2b84d4793744970b;hpb=199f0ca514f9c17668eec4f935c4ba24cd789f85;p=pandora-kernel.git diff --git a/init/main.c b/init/main.c index 624266b524d4..f7fb20021d48 100644 --- a/init/main.c +++ b/init/main.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -459,7 +460,7 @@ static void noinline __init_refok rest_init(void) kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); numa_default_policy(); pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES); - kthreadd_task = find_task_by_pid(pid); + kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns); unlock_kernel(); /* @@ -543,6 +544,7 @@ asmlinkage void __init start_kernel(void) */ unwind_init(); lockdep_init(); + debug_objects_early_init(); cgroup_init_early(); local_irq_disable(); @@ -600,6 +602,7 @@ asmlinkage void __init start_kernel(void) softirq_init(); timekeeping_init(); time_init(); + sched_clock_init(); profile_init(); if (!irqs_disabled()) printk("start_kernel(): bug: interrupts were enabled early\n"); @@ -638,6 +641,7 @@ asmlinkage void __init start_kernel(void) enable_debug_pagealloc(); cpu_hotplug_init(); kmem_cache_init(); + debug_objects_mem_init(); idr_init_cache(); setup_per_cpu_pageset(); numa_policy_init(); @@ -689,55 +693,57 @@ static int __init initcall_debug_setup(char *str) } __setup("initcall_debug", initcall_debug_setup); -extern initcall_t __initcall_start[], __initcall_end[]; - -static void __init do_initcalls(void) +static void __init do_one_initcall(initcall_t fn) { - initcall_t *call; int count = preempt_count(); + ktime_t t0, t1, delta; + char msgbuf[64]; + int result; - for (call = __initcall_start; call < __initcall_end; call++) { - ktime_t t0, t1, delta; - char *msg = NULL; - char msgbuf[40]; - int result; + if (initcall_debug) { + print_fn_descriptor_symbol("calling %s\n", fn); + t0 = ktime_get(); + } - if (initcall_debug) { - print_fn_descriptor_symbol("calling %s()\n", - (unsigned long) *call); - t0 = ktime_get(); - } + result = fn(); - result = (*call)(); + if (initcall_debug) { + t1 = ktime_get(); + delta = ktime_sub(t1, t0); - if (initcall_debug) { - t1 = ktime_get(); - delta = ktime_sub(t1, t0); + print_fn_descriptor_symbol("initcall %s", fn); + printk(" returned %d after %Ld msecs\n", result, + (unsigned long long) delta.tv64 >> 20); + } - print_fn_descriptor_symbol("initcall %s()", - (unsigned long) *call); - printk(" returned %d after %Ld msecs\n", result, - (unsigned long long) delta.tv64 >> 20); - } + msgbuf[0] = 0; - if (result && result != -ENODEV && initcall_debug) { - sprintf(msgbuf, "error code %d", result); - msg = msgbuf; - } - if (preempt_count() != count) { - msg = "preemption imbalance"; - preempt_count() = count; - } - if (irqs_disabled()) { - msg = "disabled interrupts"; - local_irq_enable(); - } - if (msg) { - print_fn_descriptor_symbol(KERN_WARNING "initcall %s()", - (unsigned long) *call); - printk(" returned with %s\n", msg); - } + if (result && result != -ENODEV && initcall_debug) + sprintf(msgbuf, "error code %d ", result); + + if (preempt_count() != count) { + strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); + preempt_count() = count; } + if (irqs_disabled()) { + strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); + local_irq_enable(); + } + if (msgbuf[0]) { + print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn); + printk(" returned with %s\n", msgbuf); + } +} + + +extern initcall_t __initcall_start[], __initcall_end[]; + +static void __init do_initcalls(void) +{ + initcall_t *call; + + for (call = __initcall_start; call < __initcall_end; call++) + do_one_initcall(*call); /* Make sure there is no pending stuff from the initcall sequence */ flush_scheduled_work(); @@ -802,6 +808,8 @@ static int noinline init_post(void) (void) sys_dup(0); (void) sys_dup(0); + current->signal->flags |= SIGNAL_UNKILLABLE; + if (ramdisk_execute_command) { run_init_process(ramdisk_execute_command); printk(KERN_WARNING "Failed to execute %s\n",