RTOS中中断等待时间的正确定义是什么? [英] What is the correct definition of interrupt latency in RTOS?

查看:331
本文介绍了RTOS中中断等待时间的正确定义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在RTOS中阅读了两种不同的中断等待时间"定义.

I read two different definition for 'interrupt latency' in RTOS.

  1. 在计算中,中断等待时间是指从生成中断到为中断源提供服务所经过的时间" (来源: https://en.wikipedia.org/wiki/Interrupt_latency )

  1. "In computing, interrupt latency is the time that elapses from when an interrupt is generated to when the source of the interrupt is serviced" (source: https://en.wikipedia.org/wiki/Interrupt_latency )

保证外部中断与中断处理程序启动之间的最大延迟的能力." (来源:什么使内核/OS实时?)

"The ability to guarantee a maximum latency between an external interrupt and the start of the interrupt handler." (source: What makes a kernel/OS real-time? )

现在,我的问题是中断延迟"的正确定义是什么?

Now, my question is what is the correct definition of 'interrupt latency'?

例如:

外部中断发生时间戳: 00小时:00分钟:20秒
在ISR内部跳转执行时的时间戳: 00小时:00分钟:25秒
维修后执行退出ISR的时间戳: 00 hr:00 min:43秒

External Interrupt occurrence time stamp: 00 hr:00 min:20 seconds
Time stamp when execution is jumped inside the ISR: 00 hr:00 min :25 seconds
Time stamp when execution exits ISR after servicing: 00 hr:00 min :43 seconds

现在中断等待时间是多少?是5秒吗?还是23秒?

Now what is the interrupt latency time? Is it 5 seconds? or 23 seconds?

推荐答案

我认为第一个定义是正确的,但您误解了中断在实践中的工作方式以及已服务"的含义.

I think the first definition is correct, but you have misunderstood how interrupts work in practice and what it means by "serviced".

控制流程为三阶段硬件中断->中断服务程序->处理. ISR通常很短,仅清除中断源并将进程标记为可以运行.

The control flow is three stage HW interrupt -> interrupt service routine -> process. The ISR usually is very short and merely clears the source of the interrupt and marks a process as ready to be run.

一个示例是您有一个调用read的过程以访问磁盘上的数据.该过程将一直阻塞,直到磁盘执行了IO.一旦发生IO,HW就会引发一个中断以通知进入ISR的CPU,清除该中断,然后将被阻塞的进程设置为可以调度.

An example is you have a process that calls read to access data on disk. This process will block until the disk has performed the IO. Once the IO occurs the HW raises an interrupt to notify the CPU which goes in to the ISR, clears the interrupt and then sets the process that was blocked as able to be scheduled.

为什么这是需要测量的中断等待时间?因为这是实际需要进行处理的地方.而且,如果中断需要在指定的时间内做出响应(即它是实时系统),那么我们需要知道从中断到开始处理该响应的时间.这意味着我们需要知道从中断到我们的实时流程被调度为止的等待时间.

Why is this the interrupt latency that needs to be measured? Because this is where the actual processing required is doing the work. And if the interrupt needs a response with in a specified time (i.e. it is a real time system) then we need to know the time from an interrupt until we start processing that response. Which means we need to know the latency from the interrupt until our real time process gets scheduled.

这篇关于RTOS中中断等待时间的正确定义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆