Skip to contentSkip to conversation

2.6.3 Posix scheduling violation for !SCHED_OTHER

PATCH In review Joe Korty 2 participants 2 messages Mar 23, 2004 – Mar 24, 2004

lore
Share & tools
lore

Joe Korty

author
#0 lore raw

PATCH 1/1 2.6.3 Posix scheduling violation for !SCHED_OTHER

Andrew,
The following fixes a problem where a SCHED_FIFO task would on occasion
be moved to the end of its runqueue when returned to from a preemption. Cause was do to some SCHED_OTHER code in schedule() which was being run for tasks of every policy.

Regards,
Joe

kernel/sched.c renamed from kernel/sched.c.orig +1 -1
@@ -1677,7 +1677,7 @@
 	queue = array->queue + idx;
 	next = list_entry(queue->next, task_t, run_list);
 
-	if (next->activated > 0) {
+	if (!rt_task(next) && next->activated > 0) {
 		unsigned long long delta = now - next->timestamp;
 
 		if (next->activated == 1)
#1 lore raw
Quoted 5 lines · Joe Korty

Andrew,
The following fixes a problem where a SCHED_FIFO task would on
occasion be moved to the end of its runqueue when returned to from a preemption. Cause was do to some SCHED_OTHER code in schedule() which was being run for tasks of every policy.

yes, indeed this is a bug.

kernel/sched.c line 1680

Quoted 2 lines
kernel/sched.c renamed from kernel/sched.c.orig +1 -1
-	if (next->activated > 0) {
+	if (!rt_task(next) && next->activated > 0) {

the patch looks good. Andrew, please apply.

Ingo