Re: [Announce] [patch] Modular Scheduler Core and Completely Fair Scheduler [CFS]

Linus Torvalds
2007-04-14T17:51:15Z

On Sat, 14 Apr 2007, Willy Tarreau wrote:
>
> It is clearly possible. What I found strange is that I could still fork
> processes (eg: ls, dmesg|tail), ... but not switch to another VT anymore.

Considering the patches in question, it's almost definitely just a CPU
scheduling problem with starvation.

The VT switching is obviously done by the kernel, but the kernel will
signal and wait for the "controlling process" for the VT. The most obvious
case of that is X, of course, but even in text mode I think gpm will
have taken control of the VT's it runs on (all of them), which means that
when you initiate a VT switch, the kernel will actually signal the
controlling process (gpm), and wait for it to acknowledge the switch.

If gpm doesn't get a timeslice for some reason (and it sounds like there
may be some serious unfairness after "fork()"), your behaviour is
explainable.

(NOTE! I've never actually looked at gpm sources or what it really does,
so maybe I'm wrong, and it doesn't try to do the controlling VT thing, and
something else is going on, but quite frankly, it sounds like the obvious
candidate for this bug. Explaining it with some non-scheduler-related
thing sounds unlikely, considering the patch in question).

Linus