diff options
author | Luca Abeni <luca.abeni@unitn.it> | 2015-05-18 09:00:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-19 02:39:20 -0400 |
commit | e0deda8142a60e4a39d5ba2ea47294a851b4309a (patch) | |
tree | d4e101ea9108501e60654fd8bec4c826454ba5b1 /Documentation | |
parent | c2a684930fce07f19d1a52d7bbe7474fe64fde31 (diff) |
sched/dl/Documentation: Add some notes on EDF schedulability
Add a short discussion about sufficient and necessary schedulability tests,
and add a simple example showing that if D_i != P_i then density based tests
are only sufficient.
Also add some references to scientific papers on schedulability tests for
EDF that are both necessary and sufficient, and on their computational
complexity.
Signed-off-by: Luca Abeni <luca.abeni@unitn.it>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: henrik@austad.us
Cc: juri.lelli@gmail.com
Cc: raistlin@linux.it
Link: http://lkml.kernel.org/r/1431954032-16473-7-git-send-email-luca.abeni@unitn.it
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/scheduler/sched-deadline.txt | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/Documentation/scheduler/sched-deadline.txt b/Documentation/scheduler/sched-deadline.txt index c794ebfc08a5..bd4123b761e5 100644 --- a/Documentation/scheduler/sched-deadline.txt +++ b/Documentation/scheduler/sched-deadline.txt | |||
@@ -137,6 +137,9 @@ CONTENTS | |||
137 | A real-time task can be periodic with period P if r_{j+1} = r_j + P, or | 137 | A real-time task can be periodic with period P if r_{j+1} = r_j + P, or |
138 | sporadic with minimum inter-arrival time P is r_{j+1} >= r_j + P. Finally, | 138 | sporadic with minimum inter-arrival time P is r_{j+1} >= r_j + P. Finally, |
139 | d_j = r_j + D, where D is the task's relative deadline. | 139 | d_j = r_j + D, where D is the task's relative deadline. |
140 | Summing up, a real-time task can be described as | ||
141 | Task = (WCET, D, P) | ||
142 | |||
140 | The utilization of a real-time task is defined as the ratio between its | 143 | The utilization of a real-time task is defined as the ratio between its |
141 | WCET and its period (or minimum inter-arrival time), and represents | 144 | WCET and its period (or minimum inter-arrival time), and represents |
142 | the fraction of CPU time needed to execute the task. | 145 | the fraction of CPU time needed to execute the task. |
@@ -170,9 +173,35 @@ CONTENTS | |||
170 | of the tasks running on such a CPU is smaller or equal than 1. | 173 | of the tasks running on such a CPU is smaller or equal than 1. |
171 | If D_i != P_i for some task, then it is possible to define the density of | 174 | If D_i != P_i for some task, then it is possible to define the density of |
172 | a task as WCET_i/min{D_i,P_i}, and EDF is able to respect all the deadlines | 175 | a task as WCET_i/min{D_i,P_i}, and EDF is able to respect all the deadlines |
173 | of all the tasks running on a CPU if the sum sum(WCET_i/min{D_i,P_i}) of the | 176 | of all the tasks running on a CPU if the sum of the densities of the tasks |
174 | densities of the tasks running on such a CPU is smaller or equal than 1 | 177 | running on such a CPU is smaller or equal than 1: |
175 | (notice that this condition is only sufficient, and not necessary). | 178 | sum(WCET_i / min{D_i, P_i}) <= 1 |
179 | It is important to notice that this condition is only sufficient, and not | ||
180 | necessary: there are task sets that are schedulable, but do not respect the | ||
181 | condition. For example, consider the task set {Task_1,Task_2} composed by | ||
182 | Task_1=(50ms,50ms,100ms) and Task_2=(10ms,100ms,100ms). | ||
183 | EDF is clearly able to schedule the two tasks without missing any deadline | ||
184 | (Task_1 is scheduled as soon as it is released, and finishes just in time | ||
185 | to respect its deadline; Task_2 is scheduled immediately after Task_1, hence | ||
186 | its response time cannot be larger than 50ms + 10ms = 60ms) even if | ||
187 | 50 / min{50,100} + 10 / min{100, 100} = 50 / 50 + 10 / 100 = 1.1 | ||
188 | Of course it is possible to test the exact schedulability of tasks with | ||
189 | D_i != P_i (checking a condition that is both sufficient and necessary), | ||
190 | but this cannot be done by comparing the total utilization or density with | ||
191 | a constant. Instead, the so called "processor demand" approach can be used, | ||
192 | computing the total amount of CPU time h(t) needed by all the tasks to | ||
193 | respect all of their deadlines in a time interval of size t, and comparing | ||
194 | such a time with the interval size t. If h(t) is smaller than t (that is, | ||
195 | the amount of time needed by the tasks in a time interval of size t is | ||
196 | smaller than the size of the interval) for all the possible values of t, then | ||
197 | EDF is able to schedule the tasks respecting all of their deadlines. Since | ||
198 | performing this check for all possible values of t is impossible, it has been | ||
199 | proven[4,5,6] that it is sufficient to perform the test for values of t | ||
200 | between 0 and a maximum value L. The cited papers contain all of the | ||
201 | mathematical details and explain how to compute h(t) and L. | ||
202 | In any case, this kind of analysis is too complex as well as too | ||
203 | time-consuming to be performed on-line. Hence, as explained in Section | ||
204 | 4 Linux uses an admission test based on the tasks' utilizations. | ||
176 | 205 | ||
177 | On multiprocessor systems with global EDF scheduling (non partitioned | 206 | On multiprocessor systems with global EDF scheduling (non partitioned |
178 | systems), a sufficient test for schedulability can not be based on the | 207 | systems), a sufficient test for schedulability can not be based on the |
@@ -206,6 +235,16 @@ CONTENTS | |||
206 | Symposium, 1998. http://retis.sssup.it/~giorgio/paps/1998/rtss98-cbs.pdf | 235 | Symposium, 1998. http://retis.sssup.it/~giorgio/paps/1998/rtss98-cbs.pdf |
207 | 3 - L. Abeni. Server Mechanisms for Multimedia Applications. ReTiS Lab | 236 | 3 - L. Abeni. Server Mechanisms for Multimedia Applications. ReTiS Lab |
208 | Technical Report. http://disi.unitn.it/~abeni/tr-98-01.pdf | 237 | Technical Report. http://disi.unitn.it/~abeni/tr-98-01.pdf |
238 | 4 - J. Y. Leung and M.L. Merril. A Note on Preemptive Scheduling of | ||
239 | Periodic, Real-Time Tasks. Information Processing Letters, vol. 11, | ||
240 | no. 3, pp. 115-118, 1980. | ||
241 | 5 - S. K. Baruah, A. K. Mok and L. E. Rosier. Preemptively Scheduling | ||
242 | Hard-Real-Time Sporadic Tasks on One Processor. Proceedings of the | ||
243 | 11th IEEE Real-time Systems Symposium, 1990. | ||
244 | 6 - S. K. Baruah, L. E. Rosier and R. R. Howell. Algorithms and Complexity | ||
245 | Concerning the Preemptive Scheduling of Periodic Real-Time tasks on | ||
246 | One Processor. Real-Time Systems Journal, vol. 4, no. 2, pp 301-324, | ||
247 | 1990. | ||
209 | 248 | ||
210 | 4. Bandwidth management | 249 | 4. Bandwidth management |
211 | ======================= | 250 | ======================= |