Messages in this thread Patch in this message | | | Date | Wed, 26 May 2004 13:27:26 +0200 | From | Ingo Molnar <> | Subject | Re: [CPU Hotplug PATCH] Restore Idle task's priority during CPU_DEAD notification |
| |
* Srivatsa Vaddagiri <vatsa@in.ibm.com> wrote:
> @@ -3569,6 +3569,7 @@ static int migration_call(struct notifie > rq = task_rq_lock(rq->idle, &flags); > deactivate_task(rq->idle, rq); > __setscheduler(rq->idle, SCHED_NORMAL, MAX_PRIO); > + rq->idle->prio = MAX_PRIO; > task_rq_unlock(rq, &flags); > BUG_ON(rq->nr_running != 0);
Looks good. A small nit: while your patch creates a perfectly correct idle thread too, i'd prefer the modified variant below. The __setscheduler() call is (technically) incorrect because in the SCHED_NORMAL case the prio should be zero. So it's a bit cleaner to set up the static priority to MAX_PRIO and then revert the policy to SCHED_NORMAL via __setscheduler(). Ok?
Ingo
From: Srivatsa Vaddagiri <vatsa@in.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
--- linux/kernel/sched.c.orig +++ linux/kernel/sched.c @@ -3566,7 +3566,8 @@ static int migration_call(struct notifie /* Idle task back to normal (off runqueue, low prio) */ rq = task_rq_lock(rq->idle, &flags); deactivate_task(rq->idle, rq); - __setscheduler(rq->idle, SCHED_NORMAL, MAX_PRIO); + rq->idle->static_prio = MAX_PRIO; + __setscheduler(rq->idle, SCHED_NORMAL, 0); task_rq_unlock(rq, &flags); BUG_ON(rq->nr_running != 0); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |