Commit c2ba4e3c authored by Linus Torvalds's avatar Linus Torvalds

Kernel lock exclusion is actually needed in the boot sequence,

so we need to make init_idle() aware of it so that it gets the
preempt_count initialization right.
parent d6e4bed6
...@@ -338,6 +338,7 @@ asmlinkage void __init start_kernel(void) ...@@ -338,6 +338,7 @@ asmlinkage void __init start_kernel(void)
* Interrupts are still disabled. Do necessary setups, then * Interrupts are still disabled. Do necessary setups, then
* enable them * enable them
*/ */
lock_kernel();
printk(linux_banner); printk(linux_banner);
setup_arch(&command_line); setup_arch(&command_line);
setup_per_cpu_areas(); setup_per_cpu_areas();
...@@ -405,8 +406,6 @@ asmlinkage void __init start_kernel(void) ...@@ -405,8 +406,6 @@ asmlinkage void __init start_kernel(void)
init_idle(current, smp_processor_id()); init_idle(current, smp_processor_id());
lock_kernel();
/* /*
* We count on the initial thread going ok * We count on the initial thread going ok
* Like idlers init is an unlocked kernel thread, which will * Like idlers init is an unlocked kernel thread, which will
......
...@@ -1438,7 +1438,7 @@ void __init init_idle(task_t *idle, int cpu) ...@@ -1438,7 +1438,7 @@ void __init init_idle(task_t *idle, int cpu)
idle->prio = MAX_PRIO; idle->prio = MAX_PRIO;
idle->state = TASK_RUNNING; idle->state = TASK_RUNNING;
idle->thread_info->cpu = cpu; idle->thread_info->cpu = cpu;
idle->thread_info->preempt_count = 0; idle->thread_info->preempt_count = (idle->lock_depth >= 0);
double_rq_unlock(idle_rq, rq); double_rq_unlock(idle_rq, rq);
set_tsk_need_resched(idle); set_tsk_need_resched(idle);
__restore_flags(flags); __restore_flags(flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment