Revert "sched: Fix task priority bug"
author黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 15:10:01 +0000 (23:10 +0800)
committer黄涛 <huangtao@rock-chips.com>
Sat, 30 Jul 2011 15:10:01 +0000 (23:10 +0800)
This reverts commit 18ed2ed46071a47e06820740650686da48e84dbb.

kernel/sched.c

index 84f8f1020db36c482328cc786a8255293aeee97a..3c11ae0a948d9337732ce9d0e37076d84c324ff6 100644 (file)
@@ -3164,6 +3164,10 @@ static void pull_task(struct rq *src_rq, struct task_struct *p,
        deactivate_task(src_rq, p, 0);
        set_task_cpu(p, this_cpu);
        activate_task(this_rq, p, 0);
+       /*
+        * Note that idle threads have a prio of MAX_PRIO, for this test
+        * to be always true for them.
+        */
        check_preempt_curr(this_rq, p, 0);
 }
 
@@ -6958,6 +6962,7 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
        __sched_fork(idle);
        idle->se.exec_start = sched_clock();
 
+       idle->prio = idle->normal_prio = MAX_PRIO;
        cpumask_copy(&idle->cpus_allowed, cpumask_of(cpu));
        __set_task_cpu(idle, cpu);
 
@@ -7661,6 +7666,7 @@ migration_call(struct notifier_block *nfb, unsigned long action, void *hcpu)
                spin_lock_irq(&rq->lock);
                update_rq_clock(rq);
                deactivate_task(rq, rq->idle, 0);
+               rq->idle->static_prio = MAX_PRIO;
                __setscheduler(rq, rq->idle, SCHED_NORMAL, 0);
                rq->idle->sched_class = &idle_sched_class;
                migrate_dead_tasks(cpu);