X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=init%2Fmain.c;h=86cbfd085b0127b986f73b36a7ab6f7221e1fe79;hb=7bb671e3d053226f870c333f701924986b39ee7f;hp=e97fadeec856e4a3c1144a14513e2feb0fb99d6b;hpb=09dc942c2a767e2d298f1cc9294bc19c7d7208c5;p=cascardo%2Flinux.git diff --git a/init/main.c b/init/main.c index e97fadeec856..86cbfd085b01 100644 --- a/init/main.c +++ b/init/main.c @@ -441,7 +441,6 @@ static noinline void __init_refok rest_init(void) kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns); rcu_read_unlock(); complete(&kthreadd_done); - unlock_kernel(); /* * The boot idle thread must execute schedule() @@ -563,7 +562,6 @@ asmlinkage void __init start_kernel(void) * Interrupts are still disabled. Do necessary setups, then * enable them */ - lock_kernel(); tick_init(); boot_cpu_init(); page_address_init(); @@ -723,27 +721,33 @@ core_param(initcall_debug, initcall_debug, bool, 0644); static char msgbuf[64]; -int do_one_initcall(initcall_t fn) +static int __init_or_module do_one_initcall_debug(initcall_t fn) { - int count = preempt_count(); ktime_t calltime, delta, rettime; unsigned long long duration; int ret; - if (initcall_debug) { - printk("calling %pF @ %i\n", fn, task_pid_nr(current)); - calltime = ktime_get(); - } - + printk(KERN_DEBUG "calling %pF @ %i\n", fn, task_pid_nr(current)); + calltime = ktime_get(); ret = fn(); + rettime = ktime_get(); + delta = ktime_sub(rettime, calltime); + duration = (unsigned long long) ktime_to_ns(delta) >> 10; + printk(KERN_DEBUG "initcall %pF returned %d after %lld usecs\n", fn, + ret, duration); - if (initcall_debug) { - rettime = ktime_get(); - delta = ktime_sub(rettime, calltime); - duration = (unsigned long long) ktime_to_ns(delta) >> 10; - printk("initcall %pF returned %d after %lld usecs\n", fn, - ret, duration); - } + return ret; +} + +int __init_or_module do_one_initcall(initcall_t fn) +{ + int count = preempt_count(); + int ret; + + if (initcall_debug) + ret = do_one_initcall_debug(fn); + else + ret = fn(); msgbuf[0] = 0; @@ -820,7 +824,6 @@ 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(); system_state = SYSTEM_RUNNING; numa_default_policy(); @@ -860,8 +863,6 @@ static int __init kernel_init(void * unused) * Wait until kthreadd is all set-up. */ wait_for_completion(&kthreadd_done); - lock_kernel(); - /* * init can allocate pages on any node */