【RTS笔记7】Schedulability
Schedulability 调度性简介
- 【deadlines必须准守】For hard real-time systems the deadlines must always be met.
- 【离线测试来检查是否错过deadline】Schedulability analysis provides an offline test (performed before the system is started) to check that there are no circumstances when deadlines are missed. A system is unschedulable if the scheduler does not find a way to switch between the tasks and meet all the deadlines.
- 【如果不可以在deadline前找到切换tasks方法,则unschedulable 】A system is unschedulable if the scheduler does not find a way to switch between the tasks and meet all the deadlines.
Schedulability test 调度性测试
predict the worst-case behavior of the system 【预测最坏情况】:
- Sufficient充分 :【过了就一定可调度(没过不一定)】If test is passed, then tasks are definitely schedulable (but if it is not passed, they may still be schedulable).
- Necessary必要 :【没过就必不可调度(过了不一定)】If test is not passed tasks are definitely not schedulable (but if it is passed tasks may or may not be schedulable).
- Exact (= Necessary + Sufficient)充要 :【绝对准确】The task set is schedulable if and only if it passes the test.
Schedulability Assumptions 调度性假设
fixed set of tasks:
- independent 独立,无synchronisation同步
- C i Ci Ci 执行时间 fixed worst-case execution time
- T i Ti Ti : periodic 周期,released at the start of their period
- D i Di Di: deadline死线. D i = T i Di = Ti Di=Ti deadline is equal to its period
Estimating Worst-Case Execution Time 估算执行时间
Analysis:模拟分析,需要建立模型
Measurement:直接测量,难以找出worst-case behavior
Rate Monotonic Scheduling 实时调度
Static, simple, optimal , fixed priority
Each task is assigned a (unique) fixed priority based on its execution rate
P
i
Pi
Pi:优先级。 (
T
i
<
T
j
↔
P
i
>
P
j
Ti < Tj ↔ Pi > Pj
Ti<Tj↔Pi>Pj) 周期越长优先级越低
The total utilisation should be less than 1.
Earliest Deadline First Scheduling EDF调度,最早截止时间优先调度
Dynamic
D
i
Di
Di:死线Deadline。
P
i
Pi
Pi:优先级。 (
D
i
<
D
j
↔
P
i
>
P
j
Di < Dj ↔ Pi > Pj
Di<Dj↔Pi>Pj) DDL越近优先度越高
Utilisation-based Schedulability 基于利用率的调度
Utilisation 利用率
利用率公式: U i = C i T i Ui = \dfrac{Ci}{Ti} Ui=TiCi 。执行时间 ÷ 周期。
Utilisation-based Schedulability Test
一个测试,当
U
<
=
U
‾
U<= \overline{U}
U<=U ,表示通过表示tasks必可被调度(没通过也还有机会)。
公式:
U
‾
=
N
(
2
1
/
n
−
1
)
\overline{U} = N(2^{1/n}-1)
U=N(21/n−1)
举个例子
Response-Time Analysis 应答时间分析
worst case response time 最坏响应时间:
worst case response time is the worst case execution time (Ci)最坏执行时间 plus the maximum interference (Ii)最大干扰(时间) suffered during execution
【Ri最坏响应时间= Ci最坏执行时间+Ii最大干扰时间】
R
i
=
C
i
+
I
i
Ri = Ci + Ii
Ri=Ci+Ii
Response-Time Analysis
Response Time Analysis is necessary and sufficient: If test is passed, all tasks will meet their deadlines. If test is failed, a task will miss its deadline.【测试通过则顺利完成,不通过则会错过DDL】
In this test, each task’s worst-case response time ® is calculated and compared to its deadline (D).
【目的:
R
i
Ri
Ri最坏响应时间<=
D
i
D_i
Di死线 】
R
i
≤
D
i
R_i ≤ D_i
Ri≤Di
periodic 名词解释
periodic 周期
Utilisation 利用,利用率