Skip to contentSkip to conversation

rq->curr==p not equivalent to task_running(rq,p)

PATCH In review Joe Korty 3 participants 3 messages Jan 13, 2004 – Jan 14, 2004

lore
Share & tools
lore

Joe Korty

author
#0 lore raw

PATCH 1/1 rq->curr==p not equivalent to task_running(rq,p)

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

Regards,
Joe

kernel/sched.c renamed from kernel/sched.c.0 +1 -1
diff -Nua 2.6/kernel/sched.c.0 2.6/kernel/sched.c
@@ -2062,7 +2062,7 @@
 		 * 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)
#1 lore raw
Quoted 2 lines · Joe Korty

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

Oh, good catch.

Andrew, mind taking this?

Thanks, Joe.

Robert Love

kernel/sched.c renamed from kernel/sched.c.0 +1 -1
diff -Nua 2.6/kernel/sched.c.0 2.6/kernel/sched.c
@@ -2062,7 +2062,7 @@
 		 * 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)
#2 lore raw
In reply to Joe Korty

kernel/sched.c line 2065

Quoted 5 lines · Joe Korty

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

kernel/sched.c renamed from kernel/sched.c.0 +1 -1
-		if (rq->curr == p) {
+		if (task_running(rq, p)) {

indeed - good catch. Andrew, please apply.

Ingo