# Schedulability Analysis in Fixed-Priority Real-Time Multicore Systems with Contention
## 4 Interference-Aware Schedulability Analysis for Fixed Priorities
### Interference-Aware Schedulability Analysis for Deadline Monotonic Scheduling  
Given the monocore classical test presented above, this section proposes a schedulability test that extends this test to multicore systems, considering the interference delay due to contention.  
First, we present an upper bound of WCRT, when interference is considered. This is an upper bound because it assumes that the maximum interference is always produced. Then, we provide the corresponding schedulability test. As we define an upper bound of the response time, the test that we provide is sufficient but not necessary.  
Let us start with some considerations to be taken into account. When we extend the analysis to multiple cores, would it be sufficient to consider that the worst-case response time of a task only depends on the computation times of higher-priority tasks of its core? In multicore systems with contention, the response time of a task depends on the following:  
* Its own computation time.
* The interference it is affected by (if it is a receiving task).
* The computation time of higher-priority tasks allocated to its core. And this, in turn, depends on the interference they are affected by (if they are receiving tasks). Therefore, these aspects may be considered when schedulability analysis is proposed. As stated before, the WCRT of synchronous tasks executed in a monocore system corresponds to the first activation of the tasks. In multicore systems, when interference is considered, WCRT does not necessarily have to be relative to the first activation. Let us consider an example to report this common misconception.  
Let us take task set \(\tau=[\tau_{0},\tau_{1},\tau_{2}]\), with \(\tau_{0}=(1,2,3,0)\), \(\tau_{1}=(2,4,5,1)\), and \(\tau_{2}=(1,3,5,1)\), allocated to a dual-core platform (Table 1). \(\tau_{0}\) and \(\tau_{1}\) are allocated to core \(M_{0}\), and \(\tau_{2}\), to \(M_{1}\). After allocating tasks to cores, the DM algorithm schedules tasks in each core. The execution chronogram of the task set is shown in Figure 2.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Task \(\tau\)** & **C** & **D** & **T** & **I** & **Core M** \\ \hline
0 & 1 & 2 & 3 & 0 & 0 \\
1 & 2 & 4 & 5 & 1 & 0 \\
2 & 1 & 3 & 5 & 1 & 1 \\ \hline \hline \end{tabular}
\end{table}
Table 1: System with task set \(\tau\).  
Task \(\tau_{0}\) possesses the highest priority, as it is the task with the shortest deadline. As \(I_{0}=0\), it is not a receiving task, so it does not receive any interference. \(\tau_{1}\) and \(\tau_{2}\) are receiving/broadcasting tasks (\(I_{1},I_{2}>0\)). Every time \(\tau_{1}\) is active at the same time as \(\tau_{2}\) is, interference appears. As \(\tau_{0}\) has the highest priority, \(\tau_{1}\) starts its execution at time 1, when \(\tau_{2}\) has just finished its execution, so interference does not appear. Therefore, the response time of \(\tau_{1}\) at its first activation is 3. However, at time 5, \(\tau_{1}\) and \(\tau_{2}\) are released and coincide in execution. Due to this interference and its preemption due to the release of \(\tau_{0}\), the response time of \(\tau_{1}\) at its second activation is 4. The same happens at the third activation. Then, the WCRT of \(\tau_{1}\) does not refer to its first activation. The same happens with \(\tau_{2}\).  
With this example, we can conclude that when interference is considered, the WCRT of a task may refer to any activation, not necessarily the first activation. For this reason, in multicore systems with contention, all activations of all tasks must be studied in order to ensure that the test is correct.