[ag-automation] Adding OSADL patch to 2.6.33.7 increases latency and CPU usage?

Carsten Emde C.Emde at osadl.org
Wed May 9 23:22:08 CEST 2012


Grant,

> I've been doing some interrupt latency testing using a board running a
> 400MHz ARM9 (an Atmel at19sam9g20).  I'm measuring interrupt latency
> of an ISR attached to external interrupt IRQ0. [..]
In the good old days of RTOS kernels
- C libraries could not be called concurrently by several threads
- interprocess communication was slow and lousy,
- user space mutexes were susceptible to priority inversion and
- there was no commonly accepted and available programming model for 
user-space real-time processes ...
We, therefore, had to place our real-time processing into the interrupt 
service routine, sometimes even into the NMI exception. But this was not 
an ingenious invention, it rather was a crude hack, since we had no 
better way. Such approach is
- not portable (neither to other architectures nor to other operating 
systems),
- not maintainable across kernel versions,
- not debuggable, and
- not protectable.

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 configured 
but do not forget to increase the priority of the related IRQ thread as 
well. You will be surprised how good PREEMPT_RT is. The total preemption 
latency typically decreases by a factor of 100 to 500.

BTW: the interrupt latency is primarily determined by hardware such as 
gate latencies of the input controller and interrupt processing of the 
CPU. A real-time kernel cannot make it faster, only slower - which is 
what we do :-).

Does this help?

	-Carsten.


More information about the ag-automation mailing list