Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Overload Scheduling in Real-Time Systems Dr. Pedro Mejía Alvarez Sección de Computación. CINVESTAV-IPN,

Similar presentations


Presentation on theme: "1 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Overload Scheduling in Real-Time Systems Dr. Pedro Mejía Alvarez Sección de Computación. CINVESTAV-IPN,"— Presentation transcript:

1 1 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Overload Scheduling in Real-Time Systems Dr. Pedro Mejía Alvarez Sección de Computación. CINVESTAV-IPN, México

2 2 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Outline Motivation Related Work Methodology The INCA Server Algorithm The Approximate Algorithm Analysis of the INCA Server Simulation Results

3 3 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Motivation u Many systems are provisioned incorrectly u Correctly provisioned systems have: u Changes in the environment, u Many arrivals of asynchronous events or u Faults of peripheral devices. u Overloads occur when safety is at stake  need efficient algorithm

4 4 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Related Work Best effort scheduling algorithm (Locke and Jensen): The RED (Robust Earliest Deadline) algorithm (Buttazzo): Imprecise Computations Skip Model The (m,k) Model The Elastic Task Model The Incremental Server Model.

5 5 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Best effort scheduling algorithm Rejection policy for overloaded systems based on removing tasks with the minimum value density (introduced time valued functions). (a) t U d (b) t U d (c) t U d

6 6 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real aperiodic tasks in overloaded systems. Combines criticality-based scheduling and deadline tolerance. Remove the task with least value on overload. The RED (Robust Earliest Deadline) algorithm PlanningReady queue Reject queue task Reclaiming policy Rejection policy Scheduling policy RUN

7 7 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Imprecise Computation Model Each Task is composed by a mandatory and an optional part. Mi:mandatory part of task  i Oi:optional part of task  i Mi precceds in execution to a Oi Oi could not execute or it may execute partially The deadline of Mi must be guaranteed. The deadline of Oi could be missed if necesarry. Execution of Oi refines the result obtained by Mi The goal in the scheduling of imprecise tasks is to execute the most possible number of optional parts such that: No deadline of mandatory parts is missed The error is minimized. Error is greater when more optional parts are not executed

8 8 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Example of Execution of Imprecise Tasks Task 3 misses the deadline of If optional part on its first Job At time: t =

9 9 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real The Skip Model Some Jobs can be skipped, ocassionally On-line guarantee A job is either executed within its deadline or it is rejected. Each Task is characterized by (Ci,Ti,Di,Si) Si is the minimum number of Jobs that must be executed between two consecutive skips

10 10 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real The Skip Model (Example) C1 = 1, T1 = 3; C2 = 2, T2 = 4, Si = 2

11 11 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real The Elastic Tasks Model The idea is to control the processor load by tuning the task periods Task utilization are variable with given elastic coefficients A periodic task is characterized by: (Cu, Ti0, Timin, Timax, Ei) The actual period Ti Є [Timin,Timax] Ri Timin Ti0 Timax Ei

12 12 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Problems with Related Work Criteria for rejection = discard the lesser-valued tasks. The time valued functions: difficult to obtain performance may be degraded if the system designers are not familiar with these functions. How far from optimal is the performance of the algorithms? Discarding “less critical” tasks during overload requires: exploration of a large search space (combination of tasks) to discard  solution not practical.

13 13 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Server for Scheduling Overloads Goal: Selecting Optional Parts to schedule in real-time systems under overloads. Problem: Selection while maximizing system value requires the exploration of a large number of combinations. Approach: Adjust the system workload by executing a sequence of approximate algorithms in incremental steps. At every phase, load is adjusted and solution is refined. Property: The most critical tasks in the systems are always scheduled and the total value is maximized.

14 14 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real M1M1 M3M3 M4M4 M5M5 M6M6 M2M2 O1O1 O2O2 O3O3 O6O6 O5O5 O4O4 Mandatory Parts Optional Parts OVERLOADED SYSTEM

15 15 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real M1M1 M3M3 M4M4 M5M5 M6M6 M2M2 O1O1 O2O2 O3O3 O6O6 O5O5 O4O4 Mandatory PartsOptional Parts OVERLOADED SYSTEM Optimal Solution High Complexity

16 16 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real M1M1 M3M3 M4M4 M5M5 M6M6 M2M2 Mandatory PartsOptional Parts OVERLOADED SYSTEM Low Cost Poor Solution

17 17 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real O1O1 O2O2 O3O3 O6O6 O4O4 Solution is Refined Complexity Increases INCREMENTAL EXECUTION OF A SEQUENCE OF APPROXIMATE ALGORITHMS O1O1 O2O2 O4O4 [...AP(0)][ AP(1)] [ AP(k)] Solutions

18 18 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real INCREMENTAL EXECUTION OF A SEQUENCE OF APPROXIMATE ALGORITHMS AP(0)][ AP(1)][ AP(k)] U Slack 0 1 AP(1) runs on the Slack Time recovered by AP(0) Overload Time

19 19 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Task Model Imprecise periodic tasks: 0/1 constraints The arrival of each task is aperiodic (r i instances per task). Overload is caused by optional parts. Overloads only due to new task arrivals (comp times are fixed) Optional parts may be discarded under overloaded conditions. Each task has an associated criticality value v i. Earliest Deadline First (EDF) dispatching.

20 20 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Methodology Proposed 1. Define the search space and the objective functions, 2. Define the conditions for the feasibility of a solution, 3. Find a feasible element within the search space that satisfies an optimality criteria. 4. Execute the Approximate Algorithms in an incremental fashion, during system idle times.

21 21 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Search Space SetSearch Space S 4 {1,1,1,1} S 3 {1,1,1,0} {1,1,0,1} {1,0,1,1} {0,1,1,1} S 2 {1,1,0,0} {1,0,1,0} {1,0,0,1} {0,1,1,0} {0,1,0,1} {0,0,1,1} S 1 {1,0,0,0} {0,1,0,0} {0,0,1,0} {0,0,0,1} S 0 {0,0,0,0} Each element in S denotes either a Feasible or Non-Feasible Solution Xi = 1, optional part i is chosen for execution.

22 22 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Objective Functions and Feasibility test Objective Functions: Utilization:  (s) =  m i /T i +  x j (p j /T j ) Criticality Value:  (s) =  x i (v i /T i ) Feasibility Test (utilization based) trueif  (s) <= 1 UBT(s) = falseotherwise {

23 23 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real The Optimization Problems Maximize Utilization Maximize the Value maximize  (s) maximize  (s) Subject to UBT(s)

24 24 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Formulation for Maximizing Utilization Problem: If an arriving task  I causes an overload: 1. Decide whether to accept the new task. 2. Determine the time for the scheduling of the new task. 3. Determine the optional parts to shed. 4. Maximize the usage of the resources at a low cost.

25 25 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Scheduling Server Adjust the workload in response to transient overload requests. Executes a sequence of Approximate Algorithms AP(0),..., AP(n) during idle time. At each level k, AP(k) determines which optional parts to shed to satisfy optimality criteria AP(k) obtains a solution closer to optimal than AP(k-1) but with longer execution time.

26 26 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Scheduling Server Metodology for Handling Overload 1.Activating the Incremental Server 2.Execution of AP(0): Overload Removal 3.Scheduling the New Task. 4.Execution of AP(1),..., AP(n) 5.Stopping the execution of the Server

27 27 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Scheduling Server Triggers for activating the INCA Server: 1. A new task arrives and causes an overload: UBT Test 2. A task leaves the system. While waiting for new tasks, the INCA server do not cause overhead in the system.

28 28 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Scheduling Server Execution of AP(0) yields Overload Removal: “shed the less critical optional parts” AP(0) is a greedy algorithm O(n)  finds a sub-optimal solution. If overload persists after AP(0)  the new task is rejected. Optional Tasks are temporarily suspended, not discarded.

29 29 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Scheduling Server Scheduling the New Task occurs only at the end of the longest period of all preempted tasks. The resulting utilization can not be immediately subtracted.

30 30 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Scheduling Server Incremental Execution of AP(1),..., AP(n) AP(1) runs on the slack time recovered by AP(0). Similarly, slack from AP(1) is used to run AP(2),... And so on... INCA server will execute as many AP(k)’s as possible AP(i) solution better than AP(i-1) AP(i) runtime longer than AP(i-1) Results from AP(i) may increase the utilization, reducing the amount of available slack.

31 31 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Scheduling Server Triggers for stopping the execution of the INCA Server There is no slack in the schedule to execute AP(k)  stop server AP(k) gives a solution no better than AP(k-1)  stop server After AP(n) is executed  stop server Another task arrives in the system  stop and re-start server A Task leaves the system  stop and re-start server

32 32 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Incremental Scheduling Server INCA Server: input: Set of tasks, including the newly arrived task 1: Execute AP(0); 2: if the system is still overloaded then exit; 3: Compute the start time of the new task; 4: Schedule the new task at its start time; 5: k=1; 6: while (there is slack in the schedule) do 7: Execute AP(k) (during slack time) 8: if the result (utilization) from AP(k) is better than AP(k-1) 9: then Adjust the workload (remove optional parts) 10: else exit; 11: k = k+ 1; 12: end;

33 33 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Each Approximate Algorithm Greedy algorithm to select optional parts for execution. AP(k) considers all possible (feasible) subsets in the search space with al least k optional parts. Characteristics: The time complexity of AP(k) is: O(n k+1 ) The worst-case performance ratio is: k/(k+1) For a small value of k, AP(k) give a solution “close to optimal”.

34 34 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Performance of the Approximate Algorithm Number of Solutions within x percent near optimal 1000 Simulations 10 tasks U = 120%

35 35 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Analysis of the INCA Server Results. 1.Using INCA gives better results than using NON-INCA, when the objective is to maximize  (s) ( utilization ).

36 36 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Simulation Experiments: setup 1.Measure the quality of results over a set of dynamic tasks. 2.Measure and compare the performance among several stages of our different optimality criteria 100 independent simulations (first 5 stages of AP(k)) 5,000 tasks (life time of each task: instances)

37 37 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Performance Evaluation: Metrics Criticality Ratio = CV(I) Total Criticality Utilization Ratio = CU(I) Total Utilization CU(I) =  i r i * p i r i = number of instances of task i CV(I) =  i r i * v i

38 38 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Simulation Results Utilization Ratio for up to 5 stages

39 39 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Simulation Results Criticality Ratio for up to 5 stages

40 40 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Conclusion on the INCA Server Only few stages of the INCA server are necessary for achieving near-optimal results. INCA Algorithm is easy to implement. Performance metrics (utilization and criticality) are easy to obtain for system designers.


Download ppt "1 Dr. Pedro Mejia Alvarez Curso de Sistemas de Tiempo Real Overload Scheduling in Real-Time Systems Dr. Pedro Mejía Alvarez Sección de Computación. CINVESTAV-IPN,"

Similar presentations


Ads by Google