It doesn't seem to touch the wake up order for RT threads
(wake_up_process adds the new process to the beginning of the
runqueue, this is wrong for RT threads). Otherwise it looks OK,
although I'm not very familiar with the 2.2.14 scheduler so I can't
really say.
I believe this approach has a fundamental problem, though. The current
scheduler makes prev default (if still running) before it considers
all other processes in the main loop. With this patch prev is
considered when it's encountered in the main loop. I had a patch that
did the same thing but have since decided that this is wrong for
SCHED_FIFO threads. Quote from sched_setscheduler(2):
| A call to sched_setscheduler or sched_setparam will put the
| SCHED_FIFO process identified by pid at the end of the list if it
| was runnable. ... A SCHED_FIFO process runs until either it is
| blocked by an I/O request, it is preempted by a higher priority
| process, or it calls sched_yield.
This means that a SCHED_FIFO process can be forced to the end of the
list for its priority while still running. Even so, it should continue
to run and not be preempted by another process with the same
priority. With your patch it would be preempted at the next
reschedule.
I wish I had the relevant POSIX standard to look at for this, it does
seem to be a fine point.
Regards,
Borislav
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/