Adaptive Scheduling for Real-time Network Communication - CiteSeerX

2 downloads 1317 Views 137KB Size Report
putational grids, the primary goal is to schedule concur- rent tasks across multiple ..... hensive set of classic real-time scheduler policies and tech- niques. A. Fuzzy ..... Systems (FUZZ-IEEE 94), pages 1394–1399, Orlando, Florida,. June 1994.
Adaptive Scheduling for Real-time Network Communication Sandra G. Dykes, Denise C. Varner, Jeremy Price, and Ben Abbott Abstract— Distributed real-time applications require efficient scheduling to improve processor and network utilization, and to avoid missing task deadlines. Current scheduling algorithms typically do not utilize applicationlevel information nor do they adapt to changes in application state. We describe a system in which users define dynamic, application-specific, scheduling policies using a fuzzy-logic approach based on natural language rules. The scheduler controls message order to maintain task priorities across distributed processors, and incorporates network performance information in the scheduling policy. An example is given for an avionics system simulation on a RT-CORBA middleware platform.

increasingly built with multiple processors and network communication support, while multimedia and distributed network applications rely more heavily upon quality-ofservice guarantees.

H e growing demand for real-time network devices, multimedia services, and distributed network applications has brought new complexities to the problem of resource scheduling. Solutions to the scheduling problem depend upon constraints specific to the system. Traditionally, schedulers in hard real-time embedded systems focus on meeting all deadlines for a set of tasks. Failure to meet a deadline in these systems can potentially lead to catastrophic failure and is therefore deemed unacceptable. On packet networks, scheduling policies center around ideas of fairness and throughput, with strict quality of service viewed as a desired feature rather than a necessity. Multimedia applications, for example, can tolerate some missed deadlines, and gracefully degrade when the network switches delay or drop data packets. On computational grids, the primary goal is to schedule concurrent tasks across multiple processors in such a way as to minimize total time. Performance is improved by increasing parallelism in the computation and by synchronizing the communication between processors. In such applications, a better scheduler does not change the application’s outcome, rather it reduces the time required to achieve it. Today these three formally disparate areas are evolving towards a common ground, with embedded systems

Scheduling theory and implementations are welldeveloped for single-processor real-time systems [12]. However, the complexity introduced by communicating devices on multi-processors has stretched the limits of formal scheduling theories and necessitated the use of heuristic approaches. Today’s real-time systems may encompass a variety of tasks, some with firm deadlines and others with more elastic deadlines. Similarly, some tasks may have well-known execution times, whereas other tasks can encounter communication delays that cause highly variable and unpredictable completion times. The increased complexity and unpredictability of communication systems can lead to poor performance from fixed scheduling algorithms in network operating systems and real-time devices unable to adapt to changing conditions. A scheduling policy that is optimal for one state may be less than ideal when conditions change and a new state is entered. For example, consider the classic competition of a server sending elastic TCP traffic and a high-resolution multimedia stream. As router congestion increases, the resulting delays and packet loss may render the multimedia stream useless. With feedback, the server can adapt by either giving priority to the multimedia stream or by reducing its resolution (i.e., changing the playout deadlines). This is an example of application-level scheduling, in which dynamic, domain-specific information can be used by application to tailor the scheduling policy. Low-level schedulers in operating systems and communication middleware cannot anticipate the scheduling needs of new applications, nor can they handle the variety of scheduling information used by many possible disparate applications. Moreover, application-level schedulers are relatively easier to implement and modify because they do not need to integrate with the rest of the operating system or middleware, and are independent of other applications on the same system.

The authors are with Southwest Research Institute, P.O. Box 28510, San Antonio, TX 78228-0510 USA (email: sdykes,dvarner,jprice,[email protected]).

In this paper, we describe the design and implementation of an application-level scheduler that 1) allows userdefined scheduling policies, 2) computes task priorities

Keywords— Real-time, scheduling, network communication, fuzzy logic

I. I NTRODUCTION

based on both static and dynamic inputs, and 3) shifts between different scheduling policies when triggered by current system conditions. User-defined scheduling policies are based upon fuzzy logic: the user specifies a set of linguistic rather than numerical variables, and controls scheduling behavior through the use of fuzzy rules. In the example above, an appropriate fuzzy rule might be ”if congestion is high, decrease resolution.” The exact decrease in resolution depends upon the form of the congestion function, and to what degree the congestion is considered high. Fuzzy logic has previously been applied to scheduling problems in several domains. Lee et al. [11] describe a fuzzy logic scheduler for non-preemptive real-time systems on a single processor. Zhang and Phillis [23] develop closed-form analytical expressions for fuzzy schedulers in simple parallel queuing networks. Chantrapornchai et al. [4] employ fuzzy logic to design a polynomialtime algorithm for scheduling functional units on a microprocessor. Our work is most similar to that of Brown [8] which describes a fuzzy scheduler for distributed real-time systems that incorporates communication time into the scheduling decisions. We extend Brown’s work by integrating an adaptive fuzzy scheduler into RT-CORBA middleware for distributed communication. On the user interface side, the scheduler integrates with a modeling environment that automatically generates ’C++’ code for the scheduling policy defined by the user. A primary benefit of our fuzzy scheduler is that users can define a complex scheduling policy in natural, easily-understood language. Moreover, we show that for the correct set of inputs and rules, fuzzy schedulers implement conventional scheduling algorithms and hence provide a superset of policies with no lack of generality. The advantage of our design is two-fold. First, a given scheduling policy can be tailored by the user to the corresponding application and utilized dynamic, application-specific information. Second, fuzzy logic provides a heuristic for simplifying control decisions in systems where too much complexity or too little information precludes analytical solutions. The paper is organized as follows. Section II describes scheduling algorithms for real-time systems and application-level schedulers, and discusses related work on fuzzy schedulers. In Section III, we provide background on fuzzy systems, and prove that a fuzzy system can implement conventional scheduling algorithms. Section IV details the design and implementation of our Adaptive Service Coordination (ASC) scheduler, Section V gives results for example scheduling scenarios, and Section VI contains the conclusions.

II. S CHEDULING

OF REAL - TIME TASKS

A. Static scheduling The goal of a scheduling algorithm is to allocate system resources to a set of tasks in a precedence order that meets all timing deadlines. In basic rate monotonic scheduling (RMS), periodic tasks are assigned priorities according to task frequency: tasks with higher frequencies are assigned higher priorities. RMS guarantees that in a preemptive, uniprocessor system, all deadlines will be met if the tasks are independent, execution times are bounded, there is no system overhead, and processor utilization is sufficiently tasks, this utilization bound is low [12]. For a set of given by:  







 



where is the ratio of execution time to period for task  .  RMS relies on an estimate of the worst-case exeBecause cution time, most scheduling assignments underutilize the shared resource in order to ensure deadlines are met. The corresponding reduction in throughput is accepted in hard real-time systems where deadlines are crucial, but may be considered a poor trade-off in soft real-time applications which can tolerate some fraction of late or missing tasks. B. Dynamic scheduling As system complexity increases, it becomes more difficult to estimate task execution times. Moreover, task periods may change over time, rendering the original set of RMS priority assignments invalid. Dynamic scheduling algorithms adapt to changes by using time-dependent variables when deciding which task to schedule. For example, the earliest deadline first (EDF) scheduling policy selects the task closest to its deadline, regardless of other considerations. EDF is optimal in the sense that if any task set can be successfully scheduled using fixed priorities, then that set can also be successfully scheduled with EDF [12]. (A successful schedule is one that does not miss any task deadlines.) However, EDF may result in a scheduling collapse in cases where transient or unpredictable delays cause one or more missed deadlines. The problem arises because EDF schedules tasks without taking into account whether the task has time to complete before its deadline. When a task is scheduled too close to its deadline, it may waste shared resources and delay competing tasks that might otherwise have met their own deadlines. Minimum laxity first (MLF), or least slack (LS), scheduling [20] modifies EDF by taking into account the estimated task execution time. If time remaining until a

deadline is less than the task’s estimated execution time, that task is not scheduled. As with RMS and EDF, the success of MLF depends upon the quality of information available to the scheduler. If worst-case execution time is used, MLF may incorrectly assume too little time remains and needlessly drop tasks. Conversely, using average execution time can result in missed deadlines, wasted resources, and the same scheduling collapse suffered by EDF. The MLF algorithm is most appropriate when execution times have little variability and therefore small differences between average and worst-case times. Unfortunately, network communication time on switched networks, particularly on multi-hop paths, has a notoriously high variance caused by queuing delays and overflows at the switches [14]. When the system includes multiple processors with communication, and the assumptions of task independence and zero overhead are relaxed, the scheduling problem becomes strong NP-complete [3]. Numerous heuristic variants of EDF and MLF have been proposed [1][3][6][11][21], but problem complexity issues make it difficult to assess performance guarantees of these algorithms. Dynamic scheduling is being incorporated into communication middleware. Shen et al. [19] use a profiler to collect communication information for task scheduling in MidART, a middleware package for real-time data acquisition and communication. Several real-time CORBA packages include facilities for dynamic scheduling [5][6], and the Object Management Group (OMG) is working on developing standards for dynamic scheduling in Real-Time CORBA 1.0 [7]. C. Application-level scheduling The advent of distributed real-time tasks and reliance on communication middleware such as RT-CORBA further add to system complexity. Real-time applications may be composed of multiple tasks that execute on multiple processors and communicate through shared network switches. Application-level information can be used to guide scheduling decisions and to efficiently provide feedback to the scheduler. For example, multimedia servers on the Internet can use information on packet delays and drop rates to adjust the transmission rate of a data stream, lowering resolution when congestion is detected and increasing resolution when more bandwidth becomes available. The Oracle Database Resource Manager [16] applies application-level scheduling to databases systems, allowing database administrators to partition CPU resources between active user sessions. In the area of peer-to-peer parallel computing, the AppLeS scheduler [2] uses informa-

tion on wide-area network topography and load when assigning parallel tasks to remote computing sites. D. Fuzzy schedulers In the Adaptive Service Coordination (ASC) project, we take application-level scheduling one step further by allowing users to define a scheduling policy linguistically using natural-language rules. Through an integrated interpreter and fuzzy inference engine, the ASC system automatically generates code for the user-specified scheduling policy. Other researchers have proposed the use of fuzzy logic in scheduling analysis for real-time systems [4][9][11][23]. A scheduling analysis computes the set of priorities assignments used by the run-time scheduler, and, due to its heavy computational demands, is normally executed off-line during an initialization phase or at infrequent intervals during run-time. In [11], Lee et al. use fuzzy rules to integrate a user-defined task criticality into dynamic MLF algorithms. The analysis is designed for nonpreemptive uniprocessor systems, and, because priority assignments are made prior to run-time, assumes task criticality remains fixed through execution. Zhang and Phillis [23] apply fuzzy logic to develop analytical solutions to the problem of admission control and scheduling in networks with two and three workstations. Fuzzy rules control the service queues, determining whether to admit or reject customers and deciding which class of customer receives service. Jiajun et al. [9] use a rule-based fuzzy expert system to generate a schedule of command sequences in the onboard controller for a small satellite. The scheduling analysis is run infrequently, such as when a subsystem fails or the system goals change. On a lower architectural level, Chantrapornchai et al. [4] describe a fuzzy-based approach for scheduling functional units on a microprocessor. In contrast, our approach is to evaluate and compare fuzzy priorities at scheduling time. To reduce overhead, the evaluation code is inserted during the modeling phase and compiled with the application code. Neema and Abbott [13] show that compiling a specific fuzzy priority model substantially reduces overhead when compared to an interpretive evaluation by a general fuzzy inference engine. With efficient evaluation techniques, fuzzy priority scheduling has been shown to outperform conventional RMS and EDF scheduling on several testbeds, including real-time robotic vehicles [8]. III. F UZZY

EMULATION OF CLASSIC SCHEDULERS

One of the strengths of a fuzzy priority scheduler is its generality. The appropriate choice of input variables

"A )



: 9

and rules allows a fuzzy priority scheduler to emulate both classic schedulers and newer heuristic algorithms. In this section, we describe fuzzy priority emulations of RMS, EDF, and a priority ceiling protocol. This work follows an analysis by Brown [8] which provides a more comprehensive set of classic real-time scheduler policies and techniques.

inverts priorities with respect to . The exponential function also serves to compress priority differences when abundant time remains, and to expand priority differences as tasks approach their deadlines. The combined transform produces a lateness  function with range [0,1]: 

A. Fuzzy emulation of RMS

Taking into account task readiness, the corresponding task priority becomes:    

In a rate monotonic scheduler, the intrinsic priority of task  is given by its normalized frequency: 

!#"



 

 !#"  $"&%('*)

(1)

+$#",%('*)

where is the request rate for task  , and is the request rate for the highest frequency task. Tasks blocked by I/O or communication are assigned a zero priority. RMS can therefore be defined by the fuzzy rules:

&+4 task readiness,  To express we use the boolean variable 0 , where READY and BLOCKED. Us ing appropriate membership and defuzzification functions, the fuzzy priority 6  can  be expressed as: 6

0

AND

 7

(2) 

The fuzzy scheduler selects the task with the highest 6 , which corresponds to the READY task with the highest frequency. This, by definition, is a rate monotonic scheduler. B. Fuzzy emulation of EDF The deadline, 8 , is the maximum allowable interval from the arrival of task  until its completion. In EDF, priorities depend upon task readiness and the time until the deadline. Here we also assume all deadlines are hard, therefore the EDF algorithm does not schedule a task if it has passed its deadline. These requirements are fulfilled by the rules: 1. if NOT READY, then priority is 0. 2. if time to deadline is negative, then priority is 0. 3. if READY and time to deadline is small, then priority is high.



0

AND

 B 7

(3)

(4)

To see that Eq. 4 emulates EDF, we observe that a task 3VU  U      is not READY until it arrives. Consequently, SRT G'&9 considered 0  U 6   U for and . Therefore : 9 : 9 for any two tasks  and W , 6 6YX [Z X , which is exactly the behavior of EDF.

?\ 9 %('*)

35





7

C. Fuzzy emulation of a Priority Ceiling Protocol

1. if NOT READY then priority is 0. 2. if READY and -/. is large then priority is high.

 213

6



" A(CEDGFHJILKNM O 9 P*Q



B

To determine the appropriate membership and defuzzifica',9