Re: posix realtime - how to use (was posix 4 extensions)

Stephen C. Tweedie (sct@dcs.ed.ac.uk)
Wed, 31 Jul 1996 17:26:31 +0100


Hi,

On 31 Jul 96 07:59:23 EDT, Mike Robinson <100254.357@CompuServe.COM>
said:

> Well, we've looked at what is available for real time scheduling,
> and we've started to play around with it. We're looking at fiddling
> the task structure parameters while inside a device driver, to set
> the calling tasks scheduling policy and priority, and we're still
> trying to figure out how to selectively force a re-scheduling so the
> real time tasks run when we exit from an interrupt service routine
> in the device driver.

That's easy. You just make sure that you set the global variable
"need_resched" to non-zero before you exit the interrupt, and the
return-to-user-space code will automatically do a reschedule.

> Our current efforts aren't working too well. In particular, we seem
> to be taking a big performance hit and we seem to be missing
> interrupts, tho' at this stage we can't tell for sure just what is
> happening. Though we do have embedded systems real time experience,
> we don't have a lot of experience with doing this sort of thing with
> Linux.

> The question is, Does anyone? Do you know of anyone, or is there
> anyone out there who has used real time scheduling with Linux?

There was a paper presented at last Winter Usenix from somebody who
was doing hard realtime on linux, using a low level reentrant
interrupt scheduler between the kernel and the interrupt hardware.
That sort of setup allows you to flag some interrupts as being hard
realtime, but giving other interrupts the same synchronisation
behaviour that they currently get.

There's a big difference between doing this and doing hard realtime
with user processes. There's a big cost to enabling the latter, and
it's not clear that we want to pay that cost in such a general purpose
kernel as Linux. Much better to give hard realtime guarantees to
certain critical driver routines and let them communicate with soft
realtime processes using posix.4 mechanisms.

Cheers,
Stephen.

--
Stephen Tweedie <sct@dcs.ed.ac.uk>
Department of Computer Science, Edinburgh University, Scotland.