Approaches to Real-Time Scheduling 1 Clock-Driven Scheduling approach also known as Time-Driven Scheduling is none Priority Preemptive Typically implemented using preemptive priority-based scheduling Decisions on what processes runs when is made a priori and not during system execution Scheduler schedules jobs based on time Scheduling overhead during run-time is very low Each node stores a schedule table locally and executes according to the schedule table 2 Weighted Round-Robin scheduling Used for scheduling time-share applications Used for scheduling real-time traffic in high-speed switched networks 3 Priority-Driven Scheduling Never leaves resource idle if there are any ready processes in the system Most scheduling algorithms used in non real-time systems are priority-driven Operating systems use a priority driven scheduler to schedule tasks FIFO, LIFO, SETF (Shortest Execution Time First), LETF (Longest Execution Time First) 4 Priority-Driven scheduling Preemptive Non-preemptive Dynamic priorities Static priorities Dynamic Systems Static Systems 5 Dynamic job dispatching to processors Once a ready job is at the head of the priority queue, it can be dispatched to any processor Jobs can migrate from processor to processor when preempted Clustering 6 Statically jobs are dispatched to pre-assigned processors or subsystem Processes are pre-assigned to servers or processors a priori In event of failure, processing is failed-over to hot spare (idle) processors/servers Tasks are only moved among processors when system is reconfigured Upon failure (fail-over) Operator initiated reconfiguration Processor affinity in multi-Core x86 processors, where jobs are attached to processors in the system 7 There are no reliable techniques to validate timing constraints of dynamic systems Static systems are far easier to test and validate and reliable validation technique for these systems exist Most hard real-time systems are statically dispatched systems 8 Event-Driven Scheduling Algorithms Earliest Deadline First (EDF) Algorithm The earlier the deadline, the higher the priority Assumptions: Jobs do not contend for resources, Jobs are scheduled on one processor, preemption of lower priority jobs by higher priority jobs are allowed With these assumptions, the EDF algorithm is an optimal priority preemptive scheduling algorithm An optimum scheduling algorithm is one that given valid assumptions, can produce a feasible schedule if a feasible schedule exists for the set of jobs In a preemptive system in which jobs do not contend for resources, the EDF algorithm can produce a feasible schedule of a set J of jobs on a processor if and only if J has at least one feasible schedule 9 Latest Release Time (LRT) Algorithm Job with the latest release time has a higher priority to be scheduled Schedules jobs backwards, starting from the latest release time backwards to current time Priorities are based on release time of jobs, the later the release time, the higher the priority LRT algorithm may leave the processor idle where there are jobs ready for execution Priority-driven algorithms, can not leave the processor idle when there are ready jobs LRT is not categorized as a priority-driven algorithm Like EDF algorithm, LRT algorithm is optimal when preemption is allowed, jobs do not contend for resources, on a processor 10 EDF algorithm does not require knowledge of the execution time for jobs LRT algorithm requires knowledge of execution time of jobs This is a major disadvantage for the LRT algorithm When preemption is not allowed, EDF and LRT algorithms will no longer be optimal No non-preemptive scheduling algorithm is optimal when jobs have arbitrary release times, execution time, and deadlines When we introduce more than one processor, EDF algorithm is no longer an optimal scheduling algorithm 11 Validating real-time performance of Priority-Driven systems Implementing Priority-Driven systems are easier than clockdriven Systems are easier to upgrade and modify Time-Driven schedulers, require knowledge of the release time and execution times of tasks a priori Priority-Driven schedulers do not need this information and are robust to tasks with varying release times Validating Priority-Driven systems is much harder than TimeDriven systems Timing characterization of Priority-Driven systems are difficult since these systems are not as deterministic as the Time-Driven systems 12 Validation of a system requires determination that all jobs meet their deadlines as specified by the system requirements Predictability of tasks Execution of jobs in a set of independent preempt-able jobs is predictable if priority-driven scheduling is used on a processor Validation of a set of independent, preemptive, static, single processor priority-driven systems are relatively easy since the execution of the jobs are predictable Maximum execution time is used to validate these systems 13 On line and off line scheduling Pre-computed schedules, decisions on what processes runs when is made before system execution On line scheduling, decisions on what processes runs when is made during system execution 14