1 | = Deadlock Break Benchmark |
---|
2 | |
---|
3 | This benchmark measures the average time to break a deadlock that occurs |
---|
4 | when a high priority task preempts a low priority task that is holding a |
---|
5 | resource that the high priority task needs. In RTEMS, these situations |
---|
6 | are mitigated through use of a semaphore with priority inheritance. A |
---|
7 | task holding a semaphore with priority inheritance enabled has its |
---|
8 | priority boosted to match that of the highest priority task blocked on |
---|
9 | that semaphore. |
---|
10 | |
---|
11 | == Directives |
---|
12 | |
---|
13 | * rtems_semaphore_obtain |
---|
14 | * rtems_semaphore_release |
---|
15 | * rtems_task_suspend |
---|
16 | * rtems_task_resume |
---|
17 | |
---|
18 | |
---|
19 | == Methodology |
---|
20 | |
---|
21 | This benchmark is structured in a way that is very similar to the semaphore- |
---|
22 | shuffle benchmark, but instead uses three tasks of differing priorities and |
---|
23 | suspend/resume instead of yield directives. |
---|
24 | |
---|
25 | The benchmark is run and timed once with no semaphore operations. This is the |
---|
26 | overhead time. The benchmark starts with the high priority task, which suspends |
---|
27 | itself, passing control to the mid priority task. The mid priority task then |
---|
28 | suspends itself, passing control to the low priority task. The low priority task |
---|
29 | resumes the mid priority task, which then resumes the high priority task. The |
---|
30 | process is repeated a total of BENCHMARKS times. This process is then executed |
---|
31 | with the low priority task holding a semaphore that the high priority task blocks |
---|
32 | on when trying to obtain. Due to priority inheritance (the deadlock break |
---|
33 | mechanism) the low priority task will execute instead of the mid priority task. |
---|
34 | The same system of suspend/resumes then occurs. |
---|
35 | |
---|
36 | The average is found and the overhead (the time of the first run) is subtracted |
---|
37 | out in the call to put_time. |
---|