Re: RT patch acceptance

john cooper
2005-05-25T13:15:49Z

Esben Nielsen wrote:
> On Tue, 24 May 2005, john cooper wrote:
>>I'd like to hear some technical arguments of why IRQ threads
>>are held with such suspicion...
>
> Performance! Even on RT systems you do NOT make all interrupts run in
> threads. Simple devices like UARTS run everything in interrupt context.
> Introducing a context switch for every character received on such a
> channel can be _very_ expensive.

The IRQ thread mechanism introduces a facility which offers
a benefit at an associated cost. For cases where the interrupt
payload processing is small in comparison to the associated
context switch, overhead in this case may be optimized
by running the payload processing in exception context.

But "performance" here is a vague term. It may in some cases
be preferable to incur an increased overhead of interrupt payload
processing in task context to improve overall CPU availability
or reduce interrupt lockout in code associated with the
interrupt. It is a system-wide issue depending on the system
goals.

I agree for simple devices which generate high frequency interrupts
and have trivial interrupt payload processing, the addition of
deferring the latter to task context may be unneeded overhead.
But even here it is a system-wide design issue and I don't see
a simple, universal right-way/wrong-way. In any case the choice
of either mechanisms is available.

As a data point, commercial OSes exist which strive to optimize
for non-RT throughput which by default defer all interrupt payload
processing into task context. Not that this is necessarily
conclusive here but it should offer reassurance this isn't as
radical a concept as it may seem.

-john

--
john.cooper@timesys.com