Subject: Re: Hard realtime scheduling
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Jonathan Stone <jonathan@dsg.stanford.edu>
List: tech-kern
Date: 04/11/2005 18:10:02
In message <1113262162.126026.2140.nullmailer@yamt.dyndns.org>,
YAMAMOTO Takashi writes:

>> Or, as Soda-san observes, the scheduler and runqueue are protected by
>> the big-lock; so to implement pre-emption, you must move at least
>> those outside the biglock.
>
>are you sure that runqueue is protected by biglock?
>afaik it's protected by sched_lock, not biglock.

No, I'm not sure. I took Soda-san's word for it.  After reading the
code and comments, I think you are right. Someday, I will have to
saturate an SMP machine with NIC interrupts and see if it can
context-switch on one CPU, whilst the other CPU is 100% busy in the
network stack. Anyone know offhand if i386 can do that in 2.x or newer?

OTOH, if we're talking about uniprocessor kernels on desktops/laptops
running sound and GUIs, (which was how I read the original request??),
then SCHED_LOCK() is just splsched(): arguably even less friendly to
pre-emption.