### Improve DM scheduling test

parent 68787d2d
 ... ... @@ -182,18 +182,29 @@ Fixed / static priorities, independent, preemptive, deadlines can be smaller tha \textbf{Schedulability analysis}: (sufficient but not necessary) $$\sum_{i=1}^{n} \frac{C_i}{D_i} \leq n(2^{1/n}-1) \implies \text{schedulability}$$ \textbf{Schedulatbility Condition: (sufficient and necessary)}: The worst-case is the critical instance (critical instance of a task occurs whenever the task is released simultaneously with all higher priority tasks). Assume that tasks are ordered according to relative deadlines $D_i$, then the \textcolor{red}{worst case interference} for task $i$ is $$I_i = \sum_{j=1}^{i-1} \Big\lceil\frac{t}{T_j}\Big\rceil C_j$$ $$I_1=0$$ The \textcolor{red}{longest response time} $R_i$ of a periodic task $i$ is at critical instance, $R_i=C_i+I_i$. Hence, compute in ascending order (=highest priority first) the smallest $R_i, ~i=1,...,n$ that satisfy $$R_i=C_i+\sum_{j=1}^{i-1}\Big\lceil\frac{R_i}{T_j}\Big\rceil C_j$$ and check whether $$\forall i=1,...,n: R_i\leq D_i$$ \textbf{Schedulatbility Condition: (sufficient and necessary)}:\\ The worst-case is the critical instance (critical instance of a task occurs whenever the task is released simultaneously with all higher priority tasks). Assume that tasks are ordered according to relative deadlines $D_i$ such that \begin{align} m < n \quad &\Leftrightarrow \quad D_m < D_n,\\ \intertext{then the \textcolor{red}{worst case interference} for task $i$ is} I_i &= \sum_{j=1}^{i-1} \Big\lceil\frac{t}{T_j}\Big\rceil C_j\\ I_1&=0 \end{align} The \textcolor{red}{longest response time} $R_i$ of a periodic task $i$ is at critical instance, $R_i=C_i+I_i$. Hence, compute in ascending order (=highest priority first) the smallest $R_i, ~i=1,...,n$ that satisfy $$R_i=C_i+\sum_{j=1}^{i-1}\Big\lceil\frac{R_i}{T_j}\Big\rceil C_j$$ and check whether $$\forall i=1,...,n: \qquad R_i\leq D_i.$$ This condition is both necessary and sufficient. \begin{python} Algorithm: DM_guarantee($\Gamma$){ Algorithm: DM_guarantee(ordered list $\Gamma$){ for (each $\tau_i \in \Gamma$) { I=0; do { $R=I+C_i;$ if ($R>D_i$) return(UNSCHEDULABLE); I= sum(j=1,...i-1) ( ceil($R/T_j$)*$C_j)$; I= $\sum_{j=1}^{i-1}\lceil R/T_j \rceil \cdot C_j$; } while ($I+C_i>R$); //while previous operation had any effect } ... ...
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment