SafeCPU can then begin to "loan out" the CPU to the tasks at the head of Q(F). .... IIJ. 1{17~ 5(" 12J ask 3 gets 1; IQ.sk 2 sets I ...... In: Tutorial. Hard Real-Time ...
J.King Saud Univ .. Vol. 9, Computer & Information Sci., pp. 57-93 (A.H.1417/1997)
Prospects for Predictable Dynamic Scheduling in RTDOS Bradley R. Swim,
Murat Tayli and Mohamed Benmaiza
Computer Science Department. College of Computer & Information Sciences King Saud University, Riyadh, Saudi Arabia (Received.tO April 1995; accepted for publication, 09 October 1995)
A bstra ct. Future dynamic distributed hard real-time systems may control unpredictable environments and will need operating systems that can handle unknown and changing task populations. In this extreme case, not only is task scheduling totally dynamic, but the system's topology and architecture must adapt to unforeseen configurations. This paper addresses the difficult problem of dynamic task scheduling in a Real Time Distributed Operating System (RTDOS). RTDOS is unique because it possesses the potential to map. at execution time. a flexible topology of networked nodes onto a network of tasks. Attempts will be made to characterize the predictable adaptability of the scheduler so as to relax the premn-time scheduling requirements for an RTDOS application. A scheduler architecture and dynamic deadline guarantee scheme are presented along with some experimental results.
1. Introduction
Hard real-time distributed systems can be classified into 4 major clusters with respect to their environment and behavior (Fig. 1). Even though many hard real-time systems of today are considered to be static within a predictable environment (cluster A) [1], current and future systems are seen to be more dynamic and controlling unpredictable environments(cluster C). The environment's flexibility requires new task types to be injected into the system even during production mode (e.g. space exploration, battle
management, undersea exploration) [2].
57
58
Bradley R. SWim. et at.
Today's research and development in hard distributed real-time systems focuses on dynamic systems controlling predictable environments (cluster B). These systems assume that the controlled environment is predictable to the extent that all application task types are known. From the task scheduling perspective. not all task instantiations are scheduled statically. New task requests, from predefined task types, can be scheduled dynamically within known limits. The dynamic aspect of these systems is confined to task creation and scheduling. The scheduling complexity follows an exponential path (Fig. 1) between static predictable systems and dynamic unpredictable systems (clusters A. B, C). It is obvious that task scheduling is complicated significantly if the operating system handles unknown and changing task popUlations. In this extreme case, not only is task scheduling totally dynamic, but the system's topology and architecture must adapt to unforeseen configurations. Given the complexity of task scheduling for cluster C, many assumptions must be simplified in order to build an efficient dynamic task scheduler. Currently, our Real Time Distributed Operating System (RTDOS) [3] resides in cluster B, but we are investigating the extent to which we can push RTDOS to control an unpredictable environment RTDOS is projected to be able to adapt itself to unforeseen configurations during production mode operations. This paper describes current research underway to develop a predictable dynamic scheduler for RTDOS. The existing platform currently supports predictable communication between tasks distributed within the network [4]. and synchronized clocks [5]. Because we believe that a key solution to the dynamic scheduling problem is the timely availability of resources, namely the CPU, we have implemented a Task Manager along with a medium-level CPU scheduler on top of an existing hardware lowlevel scheduler. The medium-level CPU scheduler enforces task deadlines even under transient overloads and improves CPU utilization significantly (discussed below in section 3.5). Building upon this predictable platform, the predictability of our scheduling and time-dependent resource management approaches will be analyzed in order to formalize the behavior and limitations of OUf solution. The paper is organized as follows. The next section highlights eXlstmg scheduling approaches with a focus on dynamiC scheduling. Section 3 explains the architectural model and design of the RTDOS scheduler along with some experimental results from an RIDOS scheduler prototype.
59
Prospects for Predictable Dynamic ...
Undefined
Unpredictable
Static distributed
system:; in
Dynamic
predictable environments
systems in predictable distribut~
A
Prt:dictablc
environments
B Sys/
(;
'-
;::l
0
(2,2)
•
(J)
-
:t::
2
h
0
u
c:::~
:;:;
•
8(" J L ) 4(9{)! 10 8J 1(140) 5(.9 1) task 3 get< land"", Il;
1=9
=l-8=O 0 0
Il(8 D, 0c, 2l )
3 -=3-]=2 ==2-5=0
EJDD D
»4(6[» 0c> 6J« 1(11 D' 5("
6J
usk 4 get.! lard"", 10, u,k 2 ge132
t==15
>
wk 2 gets J atl=12 ilIld 3 at /'" 15 ord fimll)" exits ta.k 1 finally exits 111"20
~2-5=O
o
Fig. 9. Queue changes by S.feCPU.
79
Prospects for Predictable Dynamic ...
SafeCPU' and tasks With 83% non CPU, 17%CPU: each task needs 1200ms 25000
~
.1 slight laxi.ty reduced finish time 50% 1
.. _ - - - - - - - - - - ,
----rr- Exit lime 0% lax _
Exit time Seq Oisp
~
Exit time 10% lax
-X- Exit time 20% lax - 0 - Exit time 50% lax
--6-Exit time 100% lax ~De8dline
for 100% lax
5000
o "'-,-+--+--+-+---+-~-+--+-. I 2 3 4 5 6 7 8 9 'sample rate in all charts is 62ms
10 11
12
13 14 15 16
17 18 19
TasklD
Fig. 10. Non CPU tasks with various laxities.
Safe.CPU and tasks with 4:2010 non CPU, 58%CPU: each task needs 1200ms
1_Exit time Seq Disp 35000
---¢- Exit time
50% lax
--+-- Deadline fa 50% lax]
T· .... · u. . . .. ......... . . ,.. ......... . ......... u .................................................. . tasks fi nish in groups
I
30000 - ...... ---- .........~-~ ............... --- ...... -- ........ -.......... . 1
25QC() !"
~
20000
15000
:~:
10000 - ...... . 5000 Q~prt:t~. -+-----~--+--+--~--+--+------+--+I-_+__~---~i----~
3
4
5
6
7
8
9
10 11
12 13 14 15 16 17 18 19
Task ID
Fig. 11. CPU-type tasks with 50% laxity.
task 1 begins at time t=O, then the tightest deadlines under 0% laxity is Td1 = ;;: 300,Td3 ;;: 350.
l00,T~
80
Bradley R. Swim. et af.
25000 20000
E 15000
r
SafeCPU and tasks with 42% non CPU. 58%CPU: each task needs 1200ms
T-- -
.
r- - ---.-.-----
-
........ Deadline for 100% liIX
~Oeadline for 10% lax
;J
....... Exit time seq Disp
E
c:; 10000 5000
I
,
I
~Exil time 10% lax
.-....-~~~i:r-o-'U
-------
I
! -ir-Exi\ time 1~
J
o
I 2
3
4
5
6
7
8
9
- I ~-+----+-
10 11 12 13 14 15 16 17 16 19
Task 10
Only the fi~ 2 ta~$ missed deadlinQS undet 0% laxity
Fig. 12. CPU-type tasks with 10°;' and 100% laxity.
Sat.CPU, 20% laxity and tasks 12 and 16 overrun Tc by over 300%
30000
25000 ~ 20000
"
~E_
E 15000
r-- --
t------1--------.
-- -- -- --. - -- -
' - - - --+-- -,
2
3
..
5
6
7
8
- + ---+--1-
9
10
11
- -+---+-+ 12 13 14 15
-~---- ,
16
17
18
19
Task ID
Fig. 13. Two tasks overrun Tc by 300%, uniform laxity of 20%.
Sequential dispatching is the simple comparison to SafeCPU. Sequential dispatching starts each task (after its release time) when all required resources are ready. No other task is started until the current task completes. The next task is dispatched in like fashion.
81
Prospects for Predictable Dynanuc ...
SafeCPU with random laxities from 0% to 19%; tasK5 12 and 16 overrun Tc by over 300%
30000 .,--" 25000 -1-
,I
-~ v~~~I~)I~~j)I~I~~;Jir!P.I~ . ~I ~ ~ o:>J..l>-J ~
J
:r)i ~ A
~..wl I,i..
.Ji ......,.l".:.. ,'+:l:-L....
.4illa.. ~~.) ~..;11 ~
Lo..b-J
~ ...;JI Jw"JIJ -..A;
U;"J 1 ~..w 4-:i
"-JJ.l:l:-1.::......:l 40~l..!J\ .:J~~I .~
J-!.-.j
~J4\ U5'...!... ~J}I .lA ~WJ - 4..L...;;,.J.1 ~~I ~ ....JWI J ('uaJJ ('WI H I ili:.!.l.1
alA ~ ...t...lA;..J I~~ t UiJI liA ~~ . RTDOS
,I.h:.ll
JJ~ '~.J-"~I ~U;,,11 :.r" ~ ~ o~~ 0yA
t-:i
.;.I~I ~ .~I ~ ~
:.r- jU ~
.4..i J ..-
4w. .ji
~l
uy rL\aj .j ~~ . l.h
J-:.! ~ J.? i~ d
e'pi ~I ..~ ~
e.,:1'
,:.1h .~•.aH
JJ..w:J.I ~~ ~~I RIDOS
~)I .jL-...aJ ~~.) illai ~ JJ~ 4.,.\..JI ~).-l.1 W J }l ~ YJ
. ~I J:.i .4.-, - .11
~L;J.b.:1~ ~
....r.- CZ-'dI
. .4....-.J ,-/"r' -1,-11
V-