RTOS 中中断延迟的正确定义是什么?

What is the correct definition of interrupt latency in RTOS?

我在 RTOS 中阅读了 '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" (来源:https://en.wikipedia.org/wiki/Interrupt_latency

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

现在,我的问题是 'interrupt latency' 的正确定义是什么?

例如:

外部中断发生时间戳:00hr:00min:20秒
在 ISR 中跳转执行时的时间戳:00 hr:00 min :25 seconds
服务后执行退出 ISR 时的时间戳:00 hr:00 min :43 seconds

现在中断延迟时间是多少?是5秒吗?还是 23 秒?

我认为第一个定义是正确的,但是您误解了中断在实践中的工作原理以及 "serviced" 的含义。

控制流程为三阶段HW中断->中断服务程序->进程。 ISR 通常很短,只是清除中断源并将进程标记为准备就绪 运行.

例如,您有一个进程调用 read 来访问磁盘上的数据。此过程将阻塞,直到磁盘执行完 IO。一旦 IO 发生,HW 引发中断以通知进入 ISR 的 CPU,清除中断,然后将被阻止的进程设置为能够被调度。

为什么这是需要测量的中断延迟?因为这是需要实际处理的地方。如果中断需要在指定时间内响应(即它是一个实时系统),那么我们需要知道从中断到我们开始处理该响应的时间。这意味着我们需要知道从中断到我们的实时进程被安排的延迟。