Skip to contentSkip to conversation

IRQ-Latency when in idle State on ARM

Xenomai-help Gilles Chanteperdrix 2 participants 4 messages Jun 5, 2009 – Jun 6, 2009 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 5 lines · Karl Tyss

Right before the cpu is put to sleep by cp15 the I-cache is being disabled in the idle task. I took this part out. So I leave the I-cache enabled when the cpu goes into the idle mode. I suppose that there is a reason for disabling the cache. I will ask my wise ARM book on monday. If this issue doesn't belong here (xenomai list) just say a word :)

Yes, you probably can not do that. You will find the answer in the documentation for the arm926EJS core, since this file only concerns this core.

On the other hand, as Bosko suggested, if you use the nohlt kernel option, you will avoid the idle function altogether, and the I-cache will not be disabled then re-enabled.

Signature · 1 line
					    Gilles.
#3 lore raw
Quoted 7 lines · Gilles Chanteperdrix
Quoted 5 lines · Karl Tyss

Right before the cpu is put to sleep by cp15 the I-cache is being disabled in the idle task. I took this part out. So I leave the I-cache enabled when the cpu goes into the idle mode. I suppose that there is a reason for disabling the cache. I will ask my wise ARM book on monday. If this issue doesn't belong here (xenomai list) just say a word :)

Quoted 7 lines

Yes, you probably can not do that. You will find the answer in the documentation for the arm926EJS core, since this file only concerns this core.

On the other hand, as Bosko suggested, if you use the nohlt kernel option, you will avoid the idle function altogether, and the I-cache will not be disabled then re-enabled.

Note that the effect you observe is due to the very special nature of your setup: since you run no significant user-space load, the irq handling function may remain in the cache, but on a realistically loaded system, the irq handling function will not be able to remain in the cache, so, the disabling of the I-cache in the idle function will not change anything with regard to the worst case latency.

Also note that using a GPIO to assess the timer interrupt latency is a bad idea: if you want to assess the timer interrupt you should register a timer, because the path in the kernel is different for the timer interrupt than for other interrupts and especially for multiplexed GPIO interrupts. But doing all this by yourself and risking to have problem that we already solved is not a good idea; what you should really do is use the latency test provided by Xenomai. It is relatively simple, covers all the cases, and is validated on many platforms.

Signature · 1 line
					    Gilles.
#4 lore raw

Hi Gilles,

Quoted 7 lines

Note that the effect you observe is due to the very special nature of your setup: since you run no significant user-space load, the irq handling function may remain in the cache, but on a realistically loaded system, the irq handling function will not be able to remain in the cache, so, the disabling of the I-cache in the idle function will not change anything with regard to the worst case latency.

you are absolutely right. Its also clear to me that the maximum latencies are more relevant but in my case I also have to know how the latencies are if the system has no load. This will be the most probable case in my system. This is a special case but I believe also a pretty common one so I have to be able to explain the behaviour in detail. Thanks to your help I am able to do this now :)

Quoted 9 lines

Also note that using a GPIO to assess the timer interrupt latency is a bad idea: if you want to assess the timer interrupt you should register a timer, because the path in the kernel is different for the timer interrupt than for other interrupts and especially for multiplexed GPIO interrupts. But doing all this by yourself and risking to have problem that we already solved is not a good idea; what you should really do is use the latency test provided by Xenomai. It is relatively simple, covers all the cases, and is validated on many platforms.

Acually I have already been using the latency test from xenomai to find the average and max latencies but the GPIO way seemed for me to be the best way to get a continous data set in order to plot the results. I am now able to record about half a million interrupts contineously in a relative short period of time. These results alone are not representative but in combination with the latency test.

So to come to an end... thank you for the quick help and if I find out something more I'll post it for the future generations :D

Regards,
Karl Tyss

#5 lore raw
Quoted 3 lines · Karl Tyss

Acually I have already been using the latency test from xenomai to find the average and max latencies but the GPIO way seemed for me to be the best way to get a continous data set in order to plot the results.

latency has an option which allows to record histograms and output the results when exiting. So, you can plot the results too.

Signature · 1 line
					    Gilles.