Commit a2329c27 authored by Robert Love's avatar Robert Love Committed by Linus Torvalds

[PATCH] Re: [PATCH] idle task preempt_count fix

On SMP systems, preempt_count is erroneously set to 1 for idle task's on
all CPU besides CPU0.  This patch sets preempt_count properly.

	Robert Love
parent ecc0b50d
...@@ -335,7 +335,6 @@ asmlinkage void __init start_kernel(void) ...@@ -335,7 +335,6 @@ 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();
...@@ -402,6 +401,9 @@ asmlinkage void __init start_kernel(void) ...@@ -402,6 +401,9 @@ asmlinkage void __init start_kernel(void)
printk("POSIX conformance testing by UNIFIX\n"); printk("POSIX conformance testing by UNIFIX\n");
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,6 +1438,7 @@ void __init init_idle(task_t *idle, int cpu) ...@@ -1438,6 +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;
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