Skip to content

Commit

Permalink
init: Remove the BKL from startup code
Browse files Browse the repository at this point in the history
I have shown by code review that no driver takes
the BKL at init time any more, so whatever the
init code was locking against is no longer there
and it is now safe to remove the BKL there.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Steven Rostedt <rostedt@goodmis>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
  • Loading branch information
Arnd Bergmann authored and Frederic Weisbecker committed Jul 9, 2010
1 parent 815c416 commit 5e3d20a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,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()
Expand Down Expand Up @@ -565,7 +564,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();
Expand Down Expand Up @@ -829,7 +827,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();
Expand Down Expand Up @@ -869,8 +866,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
*/
Expand Down
8 changes: 0 additions & 8 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,6 @@ __acquires(kernel_lock)
return -1;
}

/*
* When this gets called we hold the BKL which means that
* preemption is disabled. Various trace selftests however
* need to disable and enable preemption for successful tests.
* So we drop the BKL here and grab it after the tests again.
*/
unlock_kernel();
mutex_lock(&trace_types_lock);

tracing_selftest_running = true;
Expand Down Expand Up @@ -822,7 +815,6 @@ __acquires(kernel_lock)
#endif

out_unlock:
lock_kernel();
return ret;
}

Expand Down

0 comments on commit 5e3d20a

Please sign in to comment.