[ag-automation] Adding OSADL patch to 2.6.33.7 increases latency and CPU usage?
Carsten Emde
C.Emde at osadl.org
Thu May 10 00:56:40 CEST 2012
Grant,
>> The solution is user-space real-time programming using portable and
>> standardized POSIX calls. This is what PREEMPT_RT is made for. Please
>> repeat your tests in user space with and without PREEMPT_RT
> I can't repeat my tests in user space. I'm testing how long it takes
> a device driver ISR in the kernel to run. I've got a piece of
> hardware connected to the IRQ0 pin that needs to be serviced by its
> device driver within X microseconds of an interrupt that it produces
> by asserting the signal on the IRQ0 pin.
If X is, in fact, a single-digit number, then you probably want to use
an FPGA or similar for your project. A high-performance state-of the art
CPU is no longer able to react that fast. Most of the performance gains
(and more importantly power-efficiency gains) have been achieved at the
expense of an increased worst-case latency.
> Ah. So you're saying that the RT patches are to improve _user_space_
> response -- even at the cost of significantly increased CPU usage and
> interrupt latency.
Yes, indeed. However, the concept of doing real-time work in the ISR is
pretty much related to old-school CPUs such as Motorola's 68xxx and
similar. They have prioritized interrupts and, more importantly,
vectorized interrupts with a vector base register. This ensures that the
CPU can dereference to the ISR within a couple of instructions. Modern
CPUs and chipsets often do not provide control of interrupt priorities
and - the greatest invention on earth - shared interrupt lines make
everything worse. If the real-time interrupt arrives very shortly after
another interrupt that cannot be given a lower priority and that
requires lengthy register accesses and data transfers with disabled
interrupts, you are out of luck.
> Yes, thanks. If I understand correctly: if low interrupt latency is
> what I care about, then I'm better off without the realtime patch.
Hm, not necessarily - see above.
-Carsten.
More information about the ag-automation
mailing list