linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SCHED_RR/SCHED_FIFO and kernel threads?
@ 2005-06-16 15:25 Patrik Hägglund
  2005-06-16 15:48 ` Chris Friesen
  2005-06-16 16:01 ` Lee Revell
  0 siblings, 2 replies; 9+ messages in thread
From: Patrik Hägglund @ 2005-06-16 15:25 UTC (permalink / raw)
  To: linux-kernel

Hi all,

When I use 2.6 kernels (2.6.11) and run processes whith SCHED_RR or 
SCHED_FIFO scheduling, kernel activity - in the form of kernel threads - 
gets starved. Googling gave me this thread: 
http://www.ussg.iu.edu/hypermail/linux/kernel/0411.1/0182.html, which 
discuss the topic brifely.

As I remember it, using a 2.4 (or 2.2?) kernel it was possible to run 
processes using SCHED_RR/SCHED_FIFO scheduling classes (as defined by 
the Process Scheduling option in POSIX), at different priorities, 
whitout starving console input/output. For example, in one virtual 
terminal I stared a "supervisor" shell with SCHED_FIFO at priority 20, 
and then the job tasks I wanted to "run" in other virtual terminals, now 
still with SCHED_FIFO, but with lower priorities. If the job tasks 
dead-locked or ran into infinite loops, I just switched to the 
"supervisor" shell and killed the job tasks. I think I also - as an 
alternative - started the whole X server in "supervisor mode". I this 
way, I was able to get deterministic scheduling between tasks, and was 
still able to avoid locking the machine when things went wrong.

However, using 2.6 kernels the "supervisor mode" doesn't work anymore. 
Using virtual terminals at the console, I'm unable to switch to another 
VT (using alt-F2), or switch window focus in X.

Kernel threads seems to generally be scheduled in the SCHED_OTHER class 
(with the 'migration' thread as an exception).

As I see it, "kernel activity" shall not be starved by user-space 
processes. Therefore, I was very suprised by this behaviour when I saw 
it in 2.6.11.

Can someone explain how this is supposed to work? Is this the common 
design solution used by other operating systems that use kernel threads 
and have SCHED_RR/SCHED_FIFO scheduling (i.e. other POSIX operating 
systems with kernel threads)? Was there any discussion about the design 
when this migration of kernel acitivity into threads started?

Regards,
Patrik Hägglund

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-06-22  0:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-16 15:25 SCHED_RR/SCHED_FIFO and kernel threads? Patrik Hägglund
2005-06-16 15:48 ` Chris Friesen
2005-06-17  6:38   ` Patrik Hägglund
2005-06-17 12:37     ` Steven Rostedt
2005-06-18  8:14       ` Patrik Hägglund
2005-06-21 22:15         ` Patrik Hägglund
2005-06-21 22:18         ` Patrik Hägglund
2005-06-22  0:13           ` Lee Revell
2005-06-16 16:01 ` Lee Revell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).