• No results found

In this chapter, we surveyed some prior work on soft real-time systems. We classified soft real-time models as either deterministic or probabilistic, based on the predominant nature of the specifications in the model and the type of soft real-time guarantees provided, and under each class, surveyed a representative sampling of prior work. We then briefly discussed scheduling based on time-value functions, and finally considered prior work on soft real-time

scheduling on multiprocessors. From the survey presented in this chapter, it is quite evident that soft real-time scheduling on multiprocessors is largely an unexplored area of research. In the following chapters, we explore one part of it.

Chapter 3

Background on Pfair Scheduling

In Chapters 6, 7, and 8, we consider scheduling soft real-time systems using Pfair algorithms. Before embarking on that endeavor, this chapter describes some basic concepts of Pfair schedul- ing, provides needed background, and summarizes relevant results from prior work. Since most prior work on Pfair scheduling has been for hard real-time systems, most of the discussion in this chapter is with respect to such systems.

The chapter is organized as follows. Section 3.1 motivates the concept of Pfair scheduling. The basic elements of Pfair scheduling are described in the context of synchronous, periodic task systems in Section 3.2. Section 3.3 then describes other task models that can be Pfair- scheduled. Pfair scheduling algorithms are discussed afterwards in Section 3.4, followed by brief descriptions of some extensions that have been proposed to enhance the practicality of the Pfair approach. The chapter concludes after summarizing some definitions and results from prior work that are somewhat technical in nature and that are used in the analyses presented in later chapters.

3.1

Introduction

In most of the algorithms described so far, jobs are first-class objects in the sense that they are the basic units of work. Furthermore, timing constraints (e.g., deadlines or tardiness requirements) are associated with jobs. How job fragments execute is, in general, of little concern.

τ

1(3,7)

τ

2(3,7)

τ

3(3,7)

τ

4(3,7)

τ

5(3,7)

τ

6(3,7)

τ

7(3,7) Allocations on Processor 1 Allocations on Processor 2 Allocations on Processor 3 L E G E N D deadline miss

Processors 2 and 3 are idle in [6,7)

0 1 2 3 4 5 6 7 8 9

time

Figure 3.1: Ag-EDFschedule with a deadline miss for a task system that is feasible on three processors.

and sporadic real-time task systems on uniprocessors in polynomial time;1 however, it has

so far proved to be inadequate for constructing such schedules on multiprocessors. In what follows, we will try to illustrate why this is so.

We will begin by considering the example in Figure 3.1. In this example, seven tasks, each with an execution cost of three time units and a period of seven time units, are scheduled under g-EDF on three processors.2 A schedule for the first job of each task is shown. Here, the jobs

of τ1, . . . , τ6 complete executing by time six, whereas that of τ7 does not execute at all until

time six and its deadline is at time seven. Though the cumulative processing capacity available in [6,7) is sufficient to meet the needs of τ7’s job, restrictions on concurrency prevent it from

using all but one processor, and it misses its deadline at time 7 with two units of computation pending. It is appropriate to note that, as remarked by Liu in [81], and echoed by Baruahet al. in [25], “the simple fact that a task can use only one resource even when several of them are free at the same time adds a surprising amount of difficulty to the scheduling of multiple resources.”

1The time complexity of an online scheduling algorithm is given by the time required to make a single

scheduling decision.

2Note that the task system in this example cannot be partitioned among three processors, and hence, cannot

It is clear thatτ7’s deadline miss can be averted by appropriately substituting its execution

for those of two of the other tasks, and one may be tempted to attempt using theLLFscheduling algorithm to fix the problem. ThoughLLF can avert the deadline miss in the example above, it is not optimal either. An example of a feasible task system that misses a deadline under LLFis provided in Figure 3.2. In this example also, there exists a time interval (which is [5,6)) where a processor is idled due to concurrency restrictions, which in turn leads to the deadline miss indicated in the figure. Note that idling in this case can be avoided by postponing the execution of eitherτ1,1orτ2,1by one time unit in exchange for executingτ3,1 earlier. However,

such ad-hoc rules cannot solve this noted problem for any arbitrary task system, and until the work of Baruahet al., which is described below, it was doubtful whether systematic rules could be devised at all. In fact, fueled by some negative results, including one by Dertouzos and Mok in [47], which states that there does not exist an optimal algorithm for scheduling a set of one-shot, real-time tasks3 on a multiprocessor if notall the release times, execution costs, and deadlines of all tasks are known a priori, the problem of optimally scheduling periodic and sporadic tasks online on a multiprocessor was believed to be NP-hard, and the focus seemed to be on developing efficient heuristics [95, 113].

Finally, in [25], in their seminal work on Pfair scheduling, Baruah, Cohen, Plaxton, and Varvel showed that the problem can be elegantly solved in polynomial time by strengthening the timeliness constraints of tasks (provided some restrictions, which can alternatively be viewed as rules of their scheduling approach and which are described in the next section, are adhered to). Their solution is explained in detail in the next section. In essence, in their solution, job deadlines are met by requiring tasks to execute at approximately uniform rates given by their utilizations at all times. This is achieved by subjecting each time unit’s worth of execution of each task, later termed asubtask by Anderson and Srinivasan [15], to a deadline, and ensuring that subtask deadlines are met. Thus, in Pfair scheduling, the notion of job is subordinate, and subtasks are first-class objects.

Notational differences. Before considering Pfair scheduling in detail, we would like to alert the reader of the differences in notation with respect to that used in chapters not concerned with Pfair scheduling. In the context of Pfair scheduling, tasks are denoted using upper case letters near the end of the alphabet, such as T, U, and V. (This was mentioned earlier in

3A one-shot, real-time task releases a single job. The sole job is associated with a release time, execution

τ

3(3,9)

τ

2(5,6)

τ

1(5,6) Allocations on Processor 1 Allocations on Processor 2 miss deadline is idle Processor 2 L E G E N D 0 2 4 6 8 10 12 14 16 18 time

Figure 3.2: An LLF schedule with a deadline miss for a task system that is feasible on two processors.

Section 1.3.1.) The period and execution cost of a taskT are denotedT.pandT.e, respectively. The utilization ofT is referred to as its weight and is denotedwt(T)def= T.e/T.p.