Real time response of Linux

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

Posts: 1
Joined: Fri Oct 15, 2004 3:53 pm

Real time response of Linux

Fri Oct 15, 2004 4:14 pm

I have been measuring the performance of Linux. I started testing Linux 2.4 on the at91rm9200, but have also achieved similar results running Linux 2.6 on a Pentium desktop machine.

I have written a task that sits in a 'while(1)' loop and reads the time each pass around the loop, and compares the time against the previous loop time, recording the maximum value. This process is given the highest priority Linux can assign. There is another process that sits in a 'while(1)' doing nothing more than chewing up cpu time. The priority of this task is normal. To keep OS busy, there are actually five copies of the second task running.

Every 30 seconds, or so, the timing task stores in a buffer the maximum value read. At the end of the experiment, the values are printed to the console.

I am seeing periods of 500 milliseconds where the timing task is 'idle'. That is, the effect of the other chewing tasks is to starve the timing task (running at the highest priority) from CPU time. There is no other system activity (no LAN, no disk activity, no GDI). The results are similar for both the 2.4 kernel, and the 2.6 kernel.

Does this surprise anyone. I know Linux is not supposed to be hard real time but I thought Linux 2.6 with its pre-emptive scheduler and other enhancements would be better than this. I was expecting times of the order of a few milliseconds.

Can anyone comment please?
Location: Portugal - Lisbon
Posts: 31
Joined: Tue Jul 13, 2004 11:49 pm

Docs about Linux & Real - Time

Tue Oct 26, 2004 3:44 am

Hi graham,
I found some documentation that might answer your question about linux and real time.
Here is the link to the website:

I hope this help.

Luis de Sousa

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 3 guests