diff options
author | Andrew Morton <akpm@osdl.org> | 2004-05-26 17:36:14 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-05-26 17:36:14 -0700 |
commit | faf898a61ca5727d7857fb45407a0de77628f953 (patch) | |
tree | e394c454e8919c7c59d886430bf4a817727c34f2 /kernel | |
parent | 4ffa43b8c9b91ceda9af8d69b59c1877fe90c35e (diff) | |
download | history-faf898a61ca5727d7857fb45407a0de77628f953.tar.gz |
[PATCH] CPU Hotplug: restore Idle task's priority during CPU_DEAD notification
From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Fix a CPU Hotplug problem wherein idle task's "->prio" value is not
restored to MAX_PRIO during CPU_DEAD handling. Without this patch, once a
CPU is offlined and then later onlined, it becomes "more or less" useless
(does not run any task other than its idle task!)
Ingo said:
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().
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index b69efafcb2ca4c..2482757071d006 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -3566,7 +3566,8 @@ static int migration_call(struct notifier_block *nfb, unsigned long action, /* 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); |