• 沒有找到結果。

Real-Time Systems Scheduling Using the Distance-Constrained Model

N/A
N/A
Protected

Academic year: 2022

Share "Real-Time Systems Scheduling Using the Distance-Constrained Model"

Copied!
118
0
0

加載中.... (立即查看全文)

全文

(1)

UNIVERSITY OF CALIFORNIA IRVINE

Real-Time Systems Scheduling Using the Distance-Constrained Model

DISSERTATION

submitted in partial satisfaction of the requirements for the degree of DOCTOR OF PHILOSOPHY

in Information and Computer Science by

Chih-wen Hsueh

Dissertation Committee:

Professor Kwei-Jay Lin, Chair Professor Nikil Dutt Professor Douglas Blough

1997

(2)
(3)

The dissertation of Chih-wen Hsueh is approved and is acceptable in quality and form

for publication on microlm:

|||||||||||||||

|||||||||||||||

|||||||||||||||

Committee Chair

University of California, Irvine 1997

ii

(4)
(5)

Contents

Chapter 1

1 Introduction 1

1.1 Overview

: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

1 1.1.1 Real-Time System Model

: : : : : : : : : : : : : : : : : : : : :

2 1.1.2 Distance-Constrained Systems

: : : : : : : : : : : : : : : : : :

5 1.2 Problem Statement

: : : : : : : : : : : : : : : : : : : : : : : : : : : :

6 1.2.1 Motivation

: : : : : : : : : : : : : : : : : : : : : : : : : : : : :

7 1.3 Research Scope and Contribution

: : : : : : : : : : : : : : : : : : : :

8 1.4 Dissertation Organization

: : : : : : : : : : : : : : : : : : : : : : : :

10

2 Background 11

2.1 Fixed-Priority Scheduling

: : : : : : : : : : : : : : : : : : : : : : : :

11 2.2 Dynamic-Priority Scheduling

: : : : : : : : : : : : : : : : : : : : : : :

12 2.3 Pinwheel Scheduling

: : : : : : : : : : : : : : : : : : : : : : : : : : :

13 2.3.1 Pinwheel schedules

: : : : : : : : : : : : : : : : : : : : : : : :

13 2.3.2 Sr scheduler

: : : : : : : : : : : : : : : : : : : : : : : : : : : :

14 2.3.3 Fast On-Line Scheduler (FOLS)

: : : : : : : : : : : : : : : : :

16

3 Single-Node Pinwheel Scheduling 18

3.1 A Generalized Sr Using Dierent Bases

: : : : : : : : : : : : : : : : :

19 3.1.1 Schedulability Condition of Sr

g : : : : : : : : : : : : : : : : :

20 3.2 Scheduler Sr

b : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

22 3.2.1 Schedulability Condition of Sr

b : : : : : : : : : : : : : : : : :

24 3.2.2 Heuristics for Sr

b : : : : : : : : : : : : : : : : : : : : : : : : :

25 3.2.3 Performance Study of Sr

b

and HSr

: : : : : : : : : : : : : : :

27 3.3 Pinwheel Schedulers for Integer Distance Constraints

: : : : : : : : :

31 3.3.1 A Generalized Sx Using Dierent Bases

: : : : : : : : : : : :

31 3.3.2 Optimal Scheduler for Integer Constraints

: : : : : : : : : : :

33 3.3.3 Heuristic Scheduler HSx

: : : : : : : : : : : : : : : : : : : : :

35

iv

(6)

4 Multiple-Node Pinwheel Scheduling 41

4.1 End-to-End Scheduling Model

: : : : : : : : : : : : : : : : : : : : : :

42 4.2 Distributed Pinwheel Scheduling Algorithm

: : : : : : : : : : : : : :

44 4.2.1 Distributed Scheduler DSr

: : : : : : : : : : : : : : : : : : : :

44 4.2.2 Schedulability Condition of DSr

: : : : : : : : : : : : : : : : :

46 4.3 Pinwheel Phase Alignment

: : : : : : : : : : : : : : : : : : : : : : : :

50 4.3.1 Minimize the Total Delay

: : : : : : : : : : : : : : : : : : : :

51 4.3.2 Minimize the Maximum Delay

: : : : : : : : : : : : : : : : : :

56 4.4 Summary

: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

58

5 Time-Driven Distance-Constrained Task Model 60

5.1 SSr : A Polynomial-Time Pinwheel Schedule Constructor

: : : : : : :

61 5.2 Generating Complete Pinwheel Schedules

: : : : : : : : : : : : : : : :

65 5.2.1 O-line Pinwheel Eective Schedule Generator (OPSG)

: : : :

65 5.2.2 Time-driven On-line Pinwheel Scheduler (TOPS)

: : : : : : :

66 5.3 Implementation Issues

: : : : : : : : : : : : : : : : : : : : : : : : : :

69 5.3.1 Tasks Underrun or Overrun

: : : : : : : : : : : : : : : : : : :

70 5.3.2 Constant Period Tasks

: : : : : : : : : : : : : : : : : : : : : :

70 5.3.3 Dynamically Arriving and Leaving Tasks

: : : : : : : : : : : :

72 5.3.4 Non-real-time Tasks

: : : : : : : : : : : : : : : : : : : : : : :

74 5.3.5 OS Extension and Hardware Support

: : : : : : : : : : : : : :

74 5.4 Summary

: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

76

6 Conclusions 77

6.1 Summary of Results

: : : : : : : : : : : : : : : : : : : : : : : : : : :

78 6.2 Directions for Future Research

: : : : : : : : : : : : : : : : : : : : : :

81 6.3 Final Thoughts

: : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

84

Bibliography 86

Appendices 92

A The Correctness of Sr

g

92

B Proofs of the Lemmas 94

v

(7)

C De nitions and Algorithms of SLINE Operations 96

C.1 Algorithm: Finding the minimum of

S

(

hj

)

: : : : : : : : : : : : : : :

98 C.2 Algorithm: SUM

fSF1:::Fug : : : : : : : : : : : : : : : : : : : : :

98 C.3 Algorithm: MAX

fSF1:::Fug : : : : : : : : : : : : : : : : : : : : :

99 C.4 Algorithm: CUT

fSEwg : : : : : : : : : : : : : : : : : : : : : : : : :

101

D Proofs of Relationship Among Schedulers 104

vi

(8)

List of Figures

2.1 The (a)RM and (b)Pinwheel schedules

: : : : : : : : : : : : : : : : :

16 3.1 The density threshold of Sr

g : : : : : : : : : : : : : : : : : : : : : : :

23 3.2 Comparison of density after specialization between Sr and Sr

b : : : :

28 3.3 Comparison of schedulable tasks between Sr and Sr

b : : : : : : : : :

28 3.4 Comparison of schedulable tasks between Sr , Sr

3

and Sr

b : : : : : :

29 3.5 Comparison of schedulable tasks between Sr , Sr

10

and Sr

b : : : : :

29 3.6 Comparison of schedulable tasks between Sr , Sr

100

and Sr

b : : : : :

30 3.7 Density function of Sr

g

for Example 2.1

: : : : : : : : : : : : : : : :

32 3.8 Comparison of density after specialization between Sx and Sx

b : : : :

37 3.9 Comparison of schedulable tasks between Sx and Sx

b : : : : : : : : :

37 3.10 Comparison of schedulable tasks between Sx , Sx

3

and Sx

b : : : : :

38 3.11 Comparison of schedulable tasks between Sx , Sx

10

and Sx

b : : : : :

38 3.12 Comparison of schedulable tasks between Sx , Sx

100

and Sx

b : : : :

39 4.1 Worst case end-to-end delay for RM

: : : : : : : : : : : : : : : : : :

44 4.2 Pinwheel schedules for Nodes

N1

and

N2 : : : : : : : : : : : : : : : :

46 4.3 Schedulable set using DSr

: : : : : : : : : : : : : : : : : : : : : : : :

50 4.4 Delay functions and their sum

: : : : : : : : : : : : : : : : : : : : : :

52 4.5 Cutting SLINE (S=CUT

f

W,4

g

)

: : : : : : : : : : : : : : : : : : : : :

54 5.1 An example for calculating

s5

and

f5 : : : : : : : : : : : : : : : : : :

64 6.1 The relationships among C

Sx

C

Sr

C

Sxb

and C

Srb

.

: : : : : : : : : : :

79

vii

(9)

List of Tables

5.1 Time and space complexities of dierent TOPS's

: : : : : : : : : : : :

69 6.1 Various pinwheel schedulers

: : : : : : : : : : : : : : : : : : : : : : :

79 6.2 Comparison of Schedulers

: : : : : : : : : : : : : : : : : : : : : : : :

81

viii

(10)

I would like to thank my advisor Dr. Kwei-Jay Lin for his time and patience in guiding my doctoral study. His advices have always been rewarding to me both academically and in other aspects of life. I would also like to thank the members of my dissertation committee, Dr. Nikil Dutt and Dr. Douglas Blough, for their encouragement, valuable comments and advices.

My gratitude also goes to Dr. Ching-Chih Han of the Ohio State University for his important comments and inspiration on my research, Dr. Tei-Wei Kuo of the National Chung-Cheng University, Taiwan, for his advices and collaboration on my research and Dr. Kevin Tsai for his comment and partial nancial support for my study. The members of Dr. Lin's DIRECT (Distributed Real-Time Computing Technology) group also gave me unforgettable memories and help. In particular, I thank Ching-Shan Peng, Nong Fan, Steve Ahuero, Jose Miguel Pulido and especially Lee Hu.

Without the support of my family, I wouldn't have gone this far. Their un- derstanding, encouragement and sacrices help me go through the up and down of doctoral pursuit. In particular, the love, understanding and motivation from my wife Chia-Ying not only bring me a new meaning of Ph.D. pursuing but also give me the new meaning of life to strive for.

ix

(11)

x

(12)

Real-Time Systems Scheduling Using the Distance-Constrained Model by

Chih-wen Hsueh

Doctor of Philosophy in Information and Computer Science University of California, Irvine, 1997

Professor Kwei-Jay Lin, Chair

Scheduling is one of the most important fundamental issues in real-time systems. Schedu- lability and predictability are the two most important metrics in real-time scheduling.

The goal in real-time scheduling is to achieve both better schedulability and predictabil- ity. Real-time tasks in the distance-constrained model have distance constraints where the temporal distance between any two consecutive completions of a task is always less than a well-dened time interval. Pinwheel scheduling algorithms have been used to provide satis- factory distance-constrained schedules. Our research is focused on the pinwheel algorithms using the single-number reduction technique where the distance constraints are transformed into harmonic values based on an integer with respect to a single number, e.g. f3,7,15,50g can be transformed tof3,6,12,48gbased on 2 with respect to 3.

We design the optimal pinwheel algorithms using the single-number reduction technique.

The optimality properties are proved and the schedulability conditions are derived. We also study the performance by simulation and compare it with a near-optimal heuristic algorithm of a polynomial-time complexity. Based on the pinwheel scheduling algorithms, we present an end-to-end scheduling algorithm for distributed real-time systems. The schedulability condition is derived and proved tight. Several phase alignment algorithms are then designed to adjust the relative start times between schedules of neighboring nodes so that the overall end-to-end delay is minimized and the maximum end-to-end delay is reduced. We also study the performance by simulation. To apply the pinwheel scheduling algorithms, we design a

xi

(13)

pinwheel schedule constructor so that the eective pinwheel schedule can be generated and stored in polynomial time and space. Several fast time-driven on-line pinwheel schedulers are then derived for dierent practical system environments.

We study the single-node and multiple-node pinwheel scheduling algorithms in distance- constrained model and develop a exible time-driven scheduling approach. Using the time- drive pinwheel scheduling approach, both good schedulability and predictability can be achieved in real-time systems.

xii

(14)

Introduction

Computer software and hardware technologies have improved dramatically in the past few years. It is expected that the processing power of computers will continue to increase in the future. However, as more information is to be processed, timing and performance problems in computer systems do not become easier to solve. With more complicated computer applications, those problems are in fact becoming more intractable. In general, the timing problems can be transformed to meeting certain timing constraints, e.g. to nish executions before certain deadlines. Real-time systems are used to support computer applications where meeting timing constraints is required. The result of a real-time system must be both logically and temporally correct. Sometimes, timeliness is even more important than the logical correctness.

1.1 Overview

Many real-time systems are safety-critical, e.g. medical care monitoring, avionics, air trac control, nuclear reactor control, automated manufacturing, and defense command and con- trol systems. Missing timing constraints may incur disastrous results. For some real-time systems such as multimedia, teleconferencing, video on demand, and Internet/Intranet applications, missing timing constraints will result in user dissatisfaction. Moreover, for

1

(15)

2 real-time systems used in trading, banking and stock markets, time is actually "money".

We need to properly schedule the tasks in real-time systems in order to solve the timing problems in the more complicated applications or, at least, make the timing behavior of the system to be more predictable. The goal is to achieve better schedulability as well as predictability so that the quality of service in real-time systems can be guaranteed. With a better schedulability, system resources can be better utilized with a more predictability, the system performance is more reliable.

1.1.1 Real-Time System Model

In many real-time systems, most parameters of the tasks are usually known a priori because the tasks are periodic in nature, i.e. requests of tasks arrive in every period. The most important parameters of a periodic task are its ready time, period, execution time, and deadline. To be more analytical, all the parameters are assumed to be constants for a task.

Since the execution time is data-dependent and environment-dependent, usually the worst case execution timeis adopted. The periodic task needs to be executed once in each period and is usually preemptable. The instance of a task in a period is called a job. The ready time is usually assumed at the beginning of a period and the deadline is at the end of the period. That is a task is ready to be executed at the beginning of a period and expected to be nished before its deadline. The deadline is hard if there is negative eect to the system once the task misses its deadline. If the task can still contribute positive partial credit to the system after missing deadline, the deadline is soft. A rm deadline refers to no eect to the system after the task reaches its deadline. A task set is schedulable if all timing constraints are met. Since the schedule is repeated after a hyperperiod, the least common multiple of the periods of all tasks, it is also the maximum length of the schedule for analyzing the periodic tasks. We call the schedule with a length of hyperperiod starting from time 0 an eective schedule. This model is called the periodic task model.

Scheduling in the periodic task model have been well-studied in the past two decades

34, 30, 40, 28, 35]. Basically, the proposed approaches can be classied into the following

(16)

categories:

1. Time-driven scheduling: In this approach, a schedule for all tasks is generated o-line.

The schedule species when each task is to execute, be preempted, resume, and nish.

Therefore, at least, the eective schedule needs to be generated. An example of this traditional approach is the cyclic executive 35].

Since the times during which each task executes are xed in the schedule, the system provides a better predictability and the optimization on the schedule can be done o-line. It is a widely used approach in existing time-critical and safety-critical sys- tems. The schedulability can also be easily checked by inspecting the schedule. Little system overhead is incurred to execute the tasks according to a pre-computed sched- ule. However, since the schedule is xed, it is inexible to handle variations in task parameters, e.g. variable execution time, or tasks that arrive dynamically. Moreover, with a duration of a hyperperiod, a large memory is usually necessary to store the schedule.

2. Priority-driven scheduling: In this approach, each task is associated with a priority.

At run time, the system chooses among the active jobs the one with the highest priority to execute next, where the active job is one who has been requested but not yet nished. Therefore, an active job with a higher priority preempts a running job with a lower priority. The system does not leave a processor idle if there is any active job. If the priority of each task (job) is xed during execution, it is called

xed-priority or static-priority scheduling 34]. On the other hand, if the priority of a task may change during the execution, it is called dynamic-priority scheduling 34].

By carefully assigning priorities to the tasks, certain timing behavior of the system can be guaranteed. Since priority-driven is an on-line scheduling approach, it is more ex- ible to deal with the variations of the task parameters. Several analytical techniques have been developed to predict the schedulability before the schedule is generated.

They have also taken some practical problems into account, such as resource sharing

(17)

4

41] or non-periodic task scheduling 45]. Therefore, although most existing real-time systems are built based on time-driven scheduling, more and more real-time systems now are built based on the priority-driven scheduling approach, especially in general purpose operation systems.

Although time-driven scheduling approach is less exible, some schedule optimization can be done before tasks start executing. Therefore, some task sets can be schedulable using the time-driven approach but not the priority-driven approach 46]. Moreover, if there is no dynamic task arriving at run time and no task runs longer than its worst-case execution time, it is true that if a task set is schedulable using the priority-driven approach, it is schedulable using the time-driven approach as well.

In addition to the periodic task model, a real-time system may have some tasks which are not periodic. The important parameters of these tasks are arrival time, worst-case execution time, deadline, and minimum inter-arrival interval. The requests of the tasks may arrive at any time or, at best, under a certain statistical distribution. The non- periodic task with a hard deadline is called sporadic task and the one with soft deadline is called aperiodic task. The priority-driven approach is more suitable than the time-driven approach to schedule these unpredictable tasks because of its exible nature. Recently, much attentions have been focused on jointly scheduling periodic, aperiodic, and sporadic tasks 45].

Many real-time systems have complex congurations including multiprocessors, sensors and actuators. They also maintain a large set of fast-changing and short-lived data. One way to implement such systems is to divide each real-time computation a pipeline of tasks, each task running on a separate processor in a distributed system. We call such a task sequence a transaction. For example, in many military avionics applications, a Multi- Sensor Situation Assessment task is invoked periodically to evaluate new threats. The assessment may have one or more input-processing tasks collecting data from dierent sensor devices. These data are then sent to one or more processing and communication tasks so that the assessment task can decide if the response to a certain threat is necessary.

(18)

The end-to-end deadline between a sensor event and the corresponding decision for response is usually between 200 and 500 ms. Similar requirements exist in the Flight Control task which collects device data to detect any hardware/software fault, and must recongure the system within an end-to-end deadline.

In distributed real-time systems, transactions are often decomposed into a set of tasks.

The tasks are executed sequentially or concurrently on dierent processors. One of the most important timing constraints for a real-time transaction is its end-to-end deadline which is dened by the time between when the transaction is initiated by the arrival of some input data and when the transaction has completed all corresponding processing on all nodes. The primary objectives of the end-to-end scheduling for hard real-time systems are to ensure that (1) individual hard deadlines for tasks on each processor are always met, and (2) the end-to-end deadlines for all transactions are always met.

1.1.2 Distance-Constrained Systems

Tasks in real-time systems must satisfy certain timing constraints 2, 43, 29]. In addition to the ready time, deadline, and resource sharing requirements 36, 47, 48], some real-time tasks must produce outputs in regular or even constant intervals so as to meet the safety concerns and/or to provide smooth operations. This is important for real-time systems such as those used to transmit synchronized audio and video data 6, 24], or those used to control safety-critical devices 25, 26]. For example, multimedia conferencing systems must transmit and present video information and make sure that the inter-arrival time between video frames is always less than 33 ms. Avionics systems must constantly monitor engine status and decide the amount of fuel to be injected in the next cycle. Robot arms need to move smoothly or synchronously. Unpredictable output timings, or jitters 31, 32], are undesirable in these applications.

One way to ensure less output jitters is to make sure that the temporal distance 12]

between any two consecutive executions of a task stream is always less than a well-dened time interval. Such systems are called Distance-Constrained Task System (DCTS) 11]. In

(19)

6 a distance-constrained (DC) task set

T

= f

T

1

T

2

::: T

ng, every task

T

i consists of an innite sequence of jobs

J

i1

J

i2

J

i3 . Task

T

i has an execution time

e

i and a temporal distance constraint

c

i. The temporal distance between two jobs of a task is dened to be the dierence of the nish times of these two jobs. The distance constraint

c

i requires that the distance between any two consecutive jobs of

T

i must be 

c

i.

DCTS is dierent from the periodic task model mainly in that the inter-completion interval of a periodic task could be as long as twice the period length minus the task execution time. Since, in the periodic task model, each task can be executed anytime in its period provided that the deadline is met, the jitter eect is inevitable. Pinwheel algorithms 15, 16, 9, 33, 22, 32] have been used to produce satisfactory DCTS schedules.

Those schedules are mostly jitter-free provided that the execution times are constants. If there are variable execution times, pinwheel algorithms still have a better jitter control than the traditional scheduling algorithms. In addition to being used as a single processor scheduler, algorithms for distributed pinwheel scheduling 22] and network scheduling 13, 8]

have also been presented. Extensions of the pinwheel scheduler for sporadic tasks and resource sharing have been proposed 32, 11]. The issues of maintaining pinwheel schedules in a dynamic network environment have been studied 17]. All these schedulers have well- dened and simple schedulability conditions so that it is easy for a system designer to check if all tasks can be successfully scheduled. This is also important if systems need to be upgraded from time to time with tasks of longer life cycle or to accept tasks that arrive dynamically.

1.2 Problem Statement

Although scheduling in real-time systems have been intensively studied in the past two decades, it is still dicult to achieve the schedulability as well as predictability especially in the more and more complicated applications. The solutions proposed are either not optimal or with a high complexity. The primary diculties are the following:

(20)

1. The length of the eective schedule, or hyperperiod, is exponential to the number of tasks. Therefore, it is dicult to analyze and predict the timing behavior in an ecient way.

2. For distributed real-time systems, eective schedules in dierent nodes with dierent lengths and the network schedule need to be incorporated. To analyze the end-to-end delay is much more dicult than the schedule in a single node.

3. It is non-trivial to generate or to store the eective schedule, even though the periods are harmonic (multiples) 9].

The problems we seek to address in this dissertation are to schedule the real-time tasks in an ecient way using the distance-constrained model so that a better predictability can be achieved as well as schedulability.

1.2.1 Motivation

Our motivation comes from the digital and analog signal processing. To have a better control and to handle the noise, analog signals are converted into digital signals. Although some of the information may be lost during the sampling, the ease of control is an over- whelming advantage using digital signals. With more and more advanced technologies and natural limitation of human perception, the loss of information can be negligible. When digital signals are converted back to analog signals, the performance maybe even better, e.g. CD-quality music. Now, the world is full of digital signals.

The pinwheel algorithms used in the distance-constrained model provides well-dened and simple schedulability conditions which are no worse than the traditional priority-driven approaches. Pinwheel algorithms transform the task periods (i.e. analog signals) into multiples (i.e. digital signals) so that the schedule is jitterless (i.e. noiseless) and with a better predictability (i.e. ease of control). Furthermore, the pinwheel schedules can be generated in polynomial time, thus the more ecient and powerful time-driven approach can be adopted in a exible fashion. Since the distance-constrained model has more strict

(21)

8 timing constraints, if a task is schedulable using the distance-constrained model but actually does not allow period transformation, it can be transformed back to the periodic task mode and be schedulable as well 21]. Therefore, we propose to schedule the real-time tasks using the distance-constrained model and we improve the complexity to generate and store the eective schedule so that the time-driven approach can be adopted for a real application.

1.3 Research Scope and Contribution

The scope of this dissertation is real-time scheduling in the distance-constrained model for both single node and multiple nodes using both time-driven and priority-driven approaches.

Our research for the DCTS scheduling problem is based on the pinwheel scheduler

Sr

9, 11].

Sr

uses a period specialization technique to transform distance constraints of all tasks to multiples based on 2, e.g. f3, 6, 12, 24g. It is called specialization because it is only one of the legal transformations based on 2. Another legal transformation for the example

f3, 6, 12, 24gcan bef3, 6, 12, 12g. Moreover, some distance constraints can be specialized to multiples based on other numbers, such asf3, 15, 75gfor base 5. We therefore study a generalized

Sr

scheduler, called

Sr

g 20], that specializes distance constraints to multiples based on any integer

g

2. Based on

Sr

g, a pinwheel scheduler

Sr

b is designed so that all possible bases are tested using

Sr

gto nd the optimal base that minimizes the total density increase due to the specialization procedure. The schedulability condition of

Sr

b and the proof of its optimality are presented. Since

Sr

b has an exponential-time complexity, we design a heuristic algorithm

HSr

to nd suboptimal solutions in polynomial time. In our simulation, we nd that the performance of

HSr

is as good as

Sr

b.

For some applications, such as slotted network scheduling 8] and OS with a large time slice resolution, distance constraints must be integers. Pinwheel algorithm

Sx

4] can be used to schedule task sets with integer distance constraints and unit execution times. Using a technique similar to

Sr

g, we present a pinwheel scheduler

Sx

g, which specializes distance constraints to integer multiples based on any integer

g

2 with the minimum total density

(22)

increase 18]. Note that the original distance constraints and execution times for

Sx

g do not need to be integers. Moreover,

Sx

g can be executed in polynomial time. Based on

Sx

g,

Sx

b tests all possible bases to nd the optimal schedule with integer distance constraints.

The proof of optimality for

Sx

b is shown. A heuristic algorithm

HSx

is also presented and its performance studied.

We also extend

Sr

to the

DSr

algorithm for transactions on multiple nodes so that all nodes are specialized at the same time and consists of only harmonic distance constraints

19]. After the schedules for individual nodes are produced, we then provide algorithms to adjust the phases (relative start times) between these nodes so that the overall end-to-end delay for transactions is minimized or reduced.

We then develop a polynomial-time algorithm

SSr

to generate the eective pinwheel schedule so that the time-driven approach can be used in the distance-constrained model.

We discuss the usage of the time-driven distance-constrained model. Several time-driven on- line pinwheel schedulers(TOPS's) are designed to execute the generated eective schedule.

The practical issues on how to implement time-driven approach in the distance-constrained model is also investigated.

Our contribution in this dissertation can be summarized as follows:

1. We have designed a polynomial-time algorithm to construct the pinwheel schedule.

No such algorithm has been published previously.

2. A tight schedulability condition for the optimal pinwheel algorithm using the single- number reduction technique for distance constraints of real-number on any base is derived.

3. We provides theoretical proofs and practical usages of optimal pinwheel algorithms using the single-number reduction technique for distance constraints of real number and integer respectively.

4. We have extended

Sr

to

DSr

so that tasks on more than one nodes are transformed (specialized) at the same time. We have also found a tight schedulability condition

(23)

10 for

DSr

.

5. An algorithm for minimizing the total end-to-end delay has been presented. The problem of minimizing the maximum end-to-end delay has also been studied.

6. We investigate how to use the time-driven approach in the distance-constrained model and several TOPS's are designed for practical system environments.

1.4 Dissertation Organization

The remainder of this dissertation is organized as follows:

In Chapter 2, we present the background on real-time scheduling. It includes previous works on xed-priority, dynamic-priority, and pinwheel scheduling. The optimal pinwheel algorithm using the single-number reduction technique for distance constraints of real num- ber and integer respectively are presented in Chapter 3. Chapter 4 presents the multiple- node pinwheel scheduling model and how to align the pinwheel schedules on dierent nodes to achieve better end-to-end delays. In Chapter 5, we present the polynomial-time al- gorithm to construct a pinwheel schedule and how to apply the time-driven approach to distance-constrained model. The dissertation is concluded in Chapter 6. Bibliography, de- tailed proofs of lemmas, and detailed descriptions of algorithms are appended at the end of the dissertation.

(24)

Background

In this chapter, we will review previous works on the xed-priority and the dynamic- priority scheduling in the periodic task model and the pinwheel scheduling in the distance- constrained model. Before we present dierent real-time scheduling approaches, let us formally dene a periodic task set. Let

T

= f

T

i = (

e

i

p

i

d

i)j 1

i



n

g be a

n

-task periodic task set with execution time

e

i, period

p

i, and deadline

d

i. W.l.o.g., we assume

p

1 

p

2 

:::



p

n. Every Task

T

i consists of a sequence of jobs

J

i1

J

i2

J

i3

:::

Each job of

T

i has the same

e

i,

p

i and

d

i. Each job needs to be executed once in every period. It is ready at the beginning of each period and must be nished before its deadline. The utilization of

T

is



(

T

) = Pni=1

e

i

=p

i.

2.1 Fixed-Priority Scheduling

The rate-monotonic (

RM

) algorithm and the deadline-monotonic (

DM

) algorithm are the two most well-known xed-priority scheduling algorithms. The

RM

algorithm assigns a task with a shorter period a higher priority, while the

DM

algorithm assigns a task with an earlier relative deadline (relative to its ready time) a higher priority. All jobs of a task share the same priority. The predictability provided by the xed-priority scheduling approach comes from that the execution of higher-priority tasks are not aected by the lower-priority

11

(25)

12 tasks.

The

RM

algorithm is optimal among xed-priority algorithms for task sets with the relative deadlines of tasks equal to or longer than their periods 34]. The

DM

algorithm is optimal among xed-priority algorithms for task sets with the relative deadlines of tasks shorter or equal to their periods 30]. They are optimal in the sense that if any task set using other xed-priority assignment is schedulable, they can nd a schedule as well.

Liu and Layland 34] provide the following sucient schedulability condition for a set of

n

independent periodic tasks, whose relative deadlines are equal to their periods.

Theorem 2.1

For a set of

n

tasks with rate-monotonic priority assignment, the least upper bound to processor utilization is

n

(21=n;1).

Therefore, for a task set

T

with

n

tasks, it is schedulable if



(

T

) 

n

(21=n;1). For



(

T

)

> n

(21=n;1), the schedulability can be checked by a completion-time test 42]. The completion-time test is based on the critical-zone theorem, which states that if a task meets its rst deadline even when all higher priority tasks become ready at the same time, it can meet all future deadlines. This schedulability condition has been further generalized in

30, 28] for tasks with arbitrary relative deadlines and the

DM

algorithm.

2.2 Dynamic-Priority Scheduling

The most well-known dynamic-priority algorithm is the earliest-deadline-rst (

EDF

) algo- rithm, which assigns a task with an earlier absolute deadline a higher priority. Hence, the priority is dynamically assigned according to the deadlines of other tasks and dierent jobs of a task may have dierent priorities. The

EDF

algorithm is optimal among all preemptive algorithms in the sense that if

EDF

cannot schedule a task set, then no other preemptive algorithm can.

The following theorem shows the schedulability condition of the

EDF

algorithm, where feasiblemeans the associated task set is schedulable. It has been proved by Liu and Layland

34].

參考文獻

相關文件

The schedulability of periodic real-time tasks using the Rate Monotonic (RM) fixed priority scheduling algorithm can be checked by summing the utilization factors of all tasks

Reading: Stankovic, et al., “Implications of Classical Scheduling Results for Real-Time Systems,” IEEE Computer, June 1995, pp.. Copyright: All rights reserved, Prof. Stankovic,

ArchIS’ architecture uses (a) XML to support temporally grouped (virtual) representations of the database history, (b) XQuery to express powerful temporal queries on such views,

• Description “pauses” story time while using plot time; there can be a nearly complete distinction between the forms of time.. • Ellipsis skips forward in story time while

◆ Understand the time evolutions of the matrix model to reveal the time evolution of string/gravity. ◆ Study the GGE and consider the application to string and

OurChain stands for all your blockchains, an autonomous platform for any blockchain, including a ChainAgent, a ChainBrowser, a ChainFoudry, a Ch ainOracle and an OurCoin with

Although many excellent resource synchronization protocols have been pro- posed, most of them are either for hard real-time task scheduling with the maxi- mum priority inversion

When? Where? What? A Real-Time System for Detecting and Tracking People.’’ Proc. International Conference on Face and Gesture Recognotion, April, pp. Pentland, “Pfinder: