Priority Inheritance Test (Real-Time Preemption)

Esben Nielsen
2004-11-21T20:29:44Z

Hi,
From realfeel I wrote a small, simple test to test how well priority
inheritance mechanism works.

Basicly it samples how long a real-time task have to wait to get into a
protected region while non-real-time tasks also try to get into the
region (a character device). Their "job" in the region is to busy-loop for
1 ms. This ought to mimic how drivers and other parts of the kernel would
work in a real real-time application: Real time tasks using the driver
while non-real-time tasks also use the same driver.

With an ideal PI mutex the time the real-time task has to wait to get the
lock should be between 0 and 1 ms. 0 when the mutex is uncongested and 1
ms when one of the non-real-time tasks just got the mutex.

I tested it on V0.7.26-0 and my own U9.2-priom. Both implementations fails
when the mutex is congested by more than 1 non-real-time task. It works
well enough when there is only one non-real-time task trying to get the
mutex, but as soon as there are more it could look like the real-time task
not always is the first on the wait queue. I.e. sometimes it has to wait 2
ms! With 4 non-real-time tasks the most common is 1-2 ms!

Code, detailed description and data can be found at
http://www.phys.au.dk/~simlo/Linux/pi_test.tgz

Esben