]> git.hungrycats.org Git - linux/commitdiff
[PATCH] setscheduler fix
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 13:13:52 +0000 (05:13 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 13:13:52 +0000 (05:13 -0800)
From: Joe Korty <joe.korty@ccur.com>

task_running(rq,p) is equivalent to (rq->curr == p) only for some
architectures.

kernel/sched.c

index 0da8927c227c20ebd77955f5834986f7cfa8b268..d233ad6a44fe04ce115d878ef48b348b5a2a8cfb 100644 (file)
@@ -2184,7 +2184,7 @@ static int setscheduler(pid_t pid, int policy, struct sched_param __user *param)
                 * our priority decreased, or if we are not currently running on
                 * this runqueue and our priority is higher than the current's
                 */
-               if (rq->curr == p) {
+               if (task_running(rq, p)) {
                        if (p->prio > oldprio)
                                resched_task(rq->curr);
                } else if (p->prio < rq->curr->prio)