# Analysis: CPU utilization bound

## On-line scheduling with dynamic priorities

### Schedulability tests

Since the schedule is built online it is important to determine a priori if a given task set meets or not its temporal requirements.

There are three types of schedulability tests:

* Based on CPU utilization.
* Based on CPU load (processor demand).
* Based on response time.&#x20;

## EDF Scheduling

EDF tests based on CPU utilization (n independent tasks, with full preemption).

* D = T
  * ![](/files/nx3S3IQgpN3SAsmzWPsW) <=> Task set is schedulable.
  * Allows using 100% of CPU with timeliness guarantees.
* D < T
  * ![](/files/Jyw4xZLd3YjGDyDTlL1I) <=> Task set is schedulable.
  * Sufficient condition, only.
  * Pessimistic test (as for RM, inflates the utilization).

### Example

#### RM Scheduling

<figure><img src="/files/UmU7xcGs1bQuh1tsPMoc" alt=""><figcaption></figcaption></figure>

* ![](/files/r2a80ec8k0GhVmWjqLux) -> 1 activation per period NOT guaranteed.
* In fact *τ3* fails a deadline!

#### EDF Scheduling

<figure><img src="/files/tMFNv9JkkmY9GmB0sGB3" alt=""><figcaption></figcaption></figure>

* ![](/files/Ixf5gjtuUr6XaQ9Qbruq)<=> one activation per period IS guaranteed.

{% hint style="info" %}

#### Note

* No deadline misses.
* Less preemptions.
* Higher jitter on quicker tasks.
* The worst-case response time does not coincide necessarily with the synchronous release.
  {% endhint %}

### Notion of fairness

Be fair on the attribution of resources (e.g. CPU).

EDF is intrinsically fairer than RM, in the sense that tasks see its relative deadline increased as the absolute deadline approaches, independently of its period or any other static parameter.

Consequences:

* Deadlines are easier to met.
* As the deadline approaches preemptions suffered by a given task are reduced.
* The slack of tasks that are quick but have large deadlines can be used by other task (higher jitter on tasks with shorter periods).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://davidjosearaujo.gitbook.io/notes-miect/sistemas-operativos-e-de-tempo-real/dynamic-priority-scheduling/analysis-cpu-utilization-bound.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
