• No results found

Schedulability Analysis using Real-Time Calculus

As mentioned earlier in Section 1.7, the streaming task model and real-time calculus framework cir- cumvent some critical limitations of the sporadic task model and allow the analysis of component-based systems to be performed in a more systematic way. In the real-time calculus framework, a component- based system is decomposed into a collection of simple processing elements (PEs). For a PE, the timing characteristics of its output event streams and remaining supply can be computed from the input arrival and supply functions. The calculated outputs serve as inputs for subsequent PEs (see Figure 1.6(a)). In this section, we briefly describe how the outputs can be calculated forFPand EDF scheduling.

respectively, that extend the plus and minus operators on functions in the min-plus algebra (LeBoudec and Thiran, 2001). The operators ⊗and ⊘, calledmax-plus convolution and max-plus deconvolution, respectively, play a similar role in the max-plus algebra. Using these operators in real-time calculus allows the expressions for output streams to be written in a concise manner.

(f⊗g)(∆) = inf 0≤λ≤∆{f(∆−λ) +g(λ)} (f⊘g)(∆) = sup λ≥0 {f(∆ +λ)−g(λ)} (f ⊗g)(∆) = sup 0≤λ≤∆ {f(∆−λ) +g(λ)} (f ⊘g)(∆) = inf 0λ≥0{f(∆ +λ)−g(λ)}

Greedy processing component. A streaming task T with arrival curves αu(∆) and αl(∆) that is exclusively scheduled on a partially-available processor with supplyβuandβlas shown in Figure 2.8(a) is one of the basic blocks in the real-time calculus framework. This configuration is called a Greedy Processing Component(GPC). Assuming thatβuandβlare given in terms of serviced jobs per time unit, the output events forT and remaining supply functions for GPC can be calculated as follows (Wandeler, 2006).

αu′(∆) = min{((αu⊗βu)⊘βl)(∆), βu(∆)}

αl′(∆) = min{((αl⊘βu)⊗βl)(∆), βl(∆)}

βu′(∆) = ((βuαl)0)(∆) βl′(∆) = ((βl−αu)⊗0)(∆)

A fixed-priority processing element is constructed by connecting several GPCs hierarchically as shown in Figure 2.8(b).

EDF element. The analysis of an EDF-based processing element is slightly more tricky. In the EDF case, each streaming task Ti is additionally characterized by the relative deadline Di and worst- and best-case job execution timesemax

i andemini , respectively. Additionally, under EDF, the supply functions βu(∆) andβl(∆) are specified as available processor time over any interval of length ∆.

It should be noted that, if components with different supply representation are connected together, then a conversion should be done. The details of conversions between event-based and time-based

(a) (b) (c) T a au l , a au’ l’ , b bu l , b bu’ l’ , T1 b bu l , b bu l , b bi i u l , T2 Ti a a1 1 u l , a ai i u l , a ai i u’ l’ , a a1 1 u l , a1 a1 u’ l’ , a1 a1 u’ l’ , Tn b bu’ l’ , b bu’ l’ ,

Figure 2.8: (a)Greedy,(b)FP, and(c)EDF processing elements in real-time calculus framework.

representations of supply can be found in Section 4.1 of (Wandeler, 2006).

The set of streaming tasks τ is schedulable under uniprocessor EDF if (2.5) below holds for each ∆≥0 (Wandeler and Thiele, 2006).

X

Ti∈τ

αui(∆−Di)·emaxi ≤βl(∆) (2.5)

In (2.5), the left-hand side is the maximum processor time needed by jobs with release times and deadlines within any interval of length ∆ to complete before their deadlines. The output supply curves for EDF processing are be calculated similarly to those for the GPC (Wandeler and Thiele, 2006).

βu′(∆) = ((βu−X Ti∈τ emini ·αli)⊘0 )(∆) βl′(∆) = ((βl−X Ti∈τ emaxi ·αui)⊗0 )(∆)

The calculation of the output event streams is more involved. Each taskTi is treated as being executed on a GPC with supply functionsβu

i(∆) andβil(∆) defined below. βiu(∆) =βu(∆)/emini βil(∆) = ((βlP Tj6=Tie max j ·αuj)⊗0)(∆) emax i

Letαu i

′′(∆) andαl i

′′

(∆) be the output event functions calculated forTischeduled using a GPC with supplyβu

i(∆) andβil(∆). The output functions forTiunder EDF scheduling are αui′(∆) = min{αui(∆ +Di),⌈αui′′(∆)⌉} αli ′ (∆) = max{αli(∆−Di),⌊αli ′′ (∆)⌋}.

Example 2.13. In this example, we illustrate basic real-time calculus analysis using a variant of the embedded automotive system from prior work (Wandeler, 2006). Figure 2.9 shows an integrated ra- dio/navigation system running on processors CPU1 and CPU2 connected with a communication bus BUS1. CPU1 runs graphical user interface and computational navigation tasks. CPU2 runs software that receives music over the radio and monitors the traffic message channel (TMC). TaskT1 is invoked when the user wants to change the sound volume. There could be at most 32 such requests per second (see the input labeled αvol in the figure). After the user’s request is processed by task T1, a four-byte change-volume message is transmitted to taskT3by communication taskC1 on BUS1. TaskT3 changes the sound volume and sends a four-byte message back to task T2 that updates the screen showing the volume change.

Similarly, task T4 receives TMC messages (typically 300 messages per 15 minutes) with traffic infor- mation over the radio (inputαtmc). Task T4 performs initial decoding of these messages by extracting feature and location information and passes this information using 64-byte messages to task T5. Task T5 finishes the decoding, maps the features using location database, and displays relevant changes on the screen.

We have analyzed the system using basic real-time calculus analysis. We have assumed strictly periodic input event streams and system parameters as summarized in Table 2.1. We have found that the delay between user input and screen update is at most 18ms and the delay between the receipt of a TMC message and screen update is at most 218ms.

In recent papers, real-time calculus has been extended in several directions. First, some concepts of timed automata have been incorporated into real-time calculus to improve the accuracy of the anal- ysis (Huang et al., 2007; Phan et al., 2008). Second, the basic analysis was extended to allow cyclic dataflow graphs (Thiele and Stoimenov, 2009). Third, the properties of some power-saving algorithms have been investigated using real-time calculus techniques (Chen et al., 2009). Fourth, real-time in- terfaces were introduced and procedures were proposed that allow assumptions on input streams and supply to be calculated fromassumptions on processed streams (Chakraborty et al., 2006). Real-time

T1 avol atmc a’tmc a’vol b1 bbus b2 C1 T3 T4 C2 C3 T2 T5

CPU1

BUS1

CPU2

UI Tasks RADIO

Figure 2.9: Scheduling network of an embedded automotive application in Example 2.13.

Table 2.1: System parameters in Example 2.13. Number of instructions inT1 105

—//—T2 5×105 —//—T3 105 —//—T4 106 —//—T5 5×106 Message size ofC1 4 bytes —//—C2 4 bytes —//—C3 64 bytes CPU1 speed 100 MIPS CPU2 speed 11 MIPS

BUS1 speed 72 kbps

interfaces enable easy checks ofcompatibilityfor any pair of connected components.

The ideas of describing the task workload and available processor time using general demand and supply functions has been used for the analysis of network packet and task scheduling. In (Sariowan et al., 1995; Cruz, 1995), the authors examine various scheduling policies (including EDF) that provide quality- of-service guarantees to network packets transferred over a communication link. In (Wu et al., 2005), the authors derive schedulability conditions for various task models under uniprocessor static-priority scheduling. Our research differs from these prior efforts in that we consider task systems scheduled on amultiprocessorusing aglobalscheduler. We also made our framework compatible to real-time calculus so that new analysis could be easily integrated into existing software tools.

2.5

Summary

In this chapter, we have presented schedulability results for sporadic task systems scheduled under GEDF on a multiprocessor platform with full processor availability. Some of these results were later adopted for checking schedulability if processor availability is limited. The analysis of restricted-capacity platforms is crucial for building frameworks for hierarchical scheduling. Three of such frameworks have been presented in this chapter. We concluded this chapter by presenting real-time calculus analysis for uniprocessor FP and EDF schedulers.

Chapter 3

Generalized Tardiness Bounds

In this chapter1, we present generalized tardiness bounds for implicit-deadline task systems scheduled on a multiprocessor.

This chapter is organized as follows. In Sections 3.1 and 3.2, we present some additional model assumptions and our scheduling framework. Then, in Section 3.3, we present our tardiness-bound derivation. In Section 3.4, we discuss some special cases and possible extensions to the analysis. As discussed later, tardiness may be different under different scheduling algorithms. In Section 3.5, we present results from experiments conducted to assess such differences. Section 3.6 concludes the chapter.

3.1

Preliminaries

We consider the problem of scheduling a set of implicit-deadline SRT tasksτ ={T1, . . . , Tn}as defined in Section 1.3 on an m-processor platform as defined in Section 1.4. All time quantities considered in this chapter are assumed to be real numbers. In addition toUsum(τ)≤m(see Section 1.5.2), we assume

Usum(τ)≤ m X k=1 c uk, (3.1)

whereuck is the long-term utilization available on processork(see Definition 1.2 in Section 1.4). Other- wise, tardiness may grow unboundedly. In this chapter, we henseforth omit the parameterτ inUsum.

We assume that eligible jobs are placed into a single global ready queue. When choosing a new job to schedule, the scheduler selects (and dequeues) the ready job of highest priority. As reiterated in

1

Contents of this chapter previously appeared in the following paper:

Leontyev, H. and Anderson, J. (2009a). Generalized tardiness bounds for global multiprocessor scheduling. Real-Time Systems. To appear.

Definition 3.3 in Section 3.3, a job is ready if it is eligible and its predecessor (if any) has completed execution. Job priorities are determined as follows.

Definition 3.1. (prioritization functions)Associated with each jobTi,jis a function of timeχ(Ti,j, t) defined fort≥0 and called itsprioritization function. Ifχ(Ti,j, t)< χ(Tk,h, t), then the priority ofTi,j is higher than the priority ofTk,h at timet. We assume that, when comparing priorities, any ties are broken arbitrarily but consistently. That is, if, χ(Ti,j, t) =χ(Tk,h, t) and χ(Ti,j, t′) =χ(Tk,h, t′), where t6=t′, then the tie is broken in favor ofT

i,j at timet iff it is broken in favor ofTi,j at time t′.