Timing of events in an ISR

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Mon Oct 18 20:24:12 UTC 2004


Till Straumann wrote:
> Mark VanderVoord wrote:
> 
>> I am sending an event from an ISR.  The task waiting
>> on the event is the highest priority task in the
>> system (priority 5... where two others are priority
>> 100+). 
>> It appears to take 150 usec on my AU1100 between the
>> actual interrupt firing, and the task being allowed to
>> run.  This processor runs at 400MHz, so this delay
>> sounds excessive to me.  If I poll the flag instead of
>> using the interrupt, I can act on it within 4 usec
>> (but I am obviously using up a lot more CPU time).
> 
> 
> I have done similar, excessive tests on powerpcs
> (~300Mhz) and the average latency observed is in the
> 'a few microseconds' ballpark which is what you'd expect.
> 
> Could you post your code (including the timing)?
> 
> Did you make sure:
>  - your ISR doesn't do excessive work
>  - your task really has the correct priority
>  - task preemption is not disabled (globally or
>    for one of your lower priority tasks)

I am beginning to think this is the case.  The Init taks is no-preempt 
so if he just let that become the application task, it would
exhibit this behavior.

>  - your code which determines the latency is correct
> 
>>
>> What factors contribute to this delay?  Is there
>> anything that I can do about it?
> 
> 
> There *must* be something wrong...
> 
> -- Till
> 
>>
>> As a side note, I noticed that there are a lot of
>> timing tests which come with RTEMS.  Would any of
>> these be useful in nailing down just how much time
>> these calls should take?
>>
>> Thanks!
>>
>> Mark S VanderVoord
>> Self-Guided Systems, LLC
>>
>> __________________________________________________
>> Do You Yahoo!?
>> Tired of spam?  Yahoo! Mail has the best spam protection around 
>> http://mail.yahoo.com 
> 
> 
> 


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list