+ All Categories
Home > Documents > Real Time Scheduling

Real Time Scheduling

Date post: 01-Jan-2016
Category:
Upload: zahir-melendez
View: 38 times
Download: 2 times
Share this document with a friend
Description:
Real Time Scheduling. Outline. About real time systems Basic Scheduling Techniques Recent Work Future Work. Real Time Systems. Correctness of the system may depend not only on the logical result of the computation but also on the time when these results are produced - PowerPoint PPT Presentation
21
Real Time Scheduling
Transcript

Real Time Scheduling

Outline About real time systems Basic Scheduling Techniques Recent Work Future Work

Real Time Systems● Correctness of the system may depend not only on the

logical result of the computation but also on the time when these results are produced

● Tasks attempt to control events or to react to events that take place in the outside world

● These external events occur in real time and processing must be able to keep up

● Processing must happen in a timely fashion, neither too late, nor too early

● Some examples include, Air Traffic Control, Robotics, Cars and aircraft systems.

Types of Real Time Systems Hard real time systems

Must always meet all deadlines System fails if deadline window is missed

Soft real time systems Must try to meet all deadlines Will execute if deadline is missed System does not fail if a few deadlines are missed

Firm real time systems Result has no use outside deadline window Tasks that fail are discarded

Real time tasks Periodic

● Each task is repeated at a regular interval● Max execution time is the same each period● Arrival time is usually the start of the period● Deadline is usually the end

● Aperiodic● Each task can arrive at any time

Real-Time Scheduling Determines the order of real time task executions Dynamic vs. Static

Dynamic schedule computed at run-time based on tasks arrival

Dynamic priorities are determined during run-time Static schedule done at compile time for all tasks, Static scheduling assigns priorities prior to run-

time

Rate Monotonic● Simplest type of real time scheduling ● Tasks are periodic, with hard deadlines● Tasks are logically independent tasks● No communication or data sharing● Tasks are scheduled according to priority

and task priorities are fixed● Computation time is known and consta

Rate Monotonic● Higher priorities usually assigned to tasks with

smaller periods● If T(h) < T(i), then PR(h) > PR(i), where T indicates

the task and PR indicates the priority. – Rate Monotonic Priority Assignment.

● Calculates the critical instant for each task. Occurs when task Ti and all higher priority tasks

are scheduled simultaneously If tasks deadline scheduled at critical instant, then

the task can always meet its deadline.

Deadline Monotonic

Tasks with shorter deadlines get higher priority. Static Scheduling. If D(h) < D(i), then PR(h) > PR(i), where D

indicates the deadline. – Deadline Monotonic Priority Assignment.

Dynamic Scheduling Tasks are Aperiodic– Tasks arrive at unknown intervals due to

an event Real time priorities vary during the system’s

execution. Priorities are reevaluated when events such

as task arrivals, events/signals causing preemption, or task completions occur

EDF: Earliest Deadline First Dynamic Scheduling Assume a preemptive system with dynamic

priorities The task with the earliest absolute deadline

executes first.• If a tie between Hard/Soft real-time task,

hard deadline runs first.

Real Time Synchronization Required when tasks are not independent and need to

share information and synchronize If two tasks want to access the same data, semaphores

are used to ensure non-simultaneous access Potential Issues

Priority Inversion – A situation in which a higher priority job is blocked by lower priority jobs for an indefinite period of time

Chain Blocking – A situation in which more than two resources are available and a high priority task is blocked off from both because of two or more lower priority tasks holding locks on one or both of the resources.

Priority Inversions Consider tasks T1, T2, and T3 with decreasing priorities and a

Semaphore S that locks a critical section.– T3 has priority and starts execution

• T3 → Lock(S)– T1 → Preempts T3

• T1 → Lock(S)– Blocks waiting for S

– T3 continues– T2 → Preempts T3

• T2 starts execution until finished

T2 have now gained higher priority over T1

Chain Blocking Consider tasks T1, T2, and T3 with decreasing priorities and

Semaphores S, R that lock two critical sections.– T3 has priority and starts execution

• T3 → Lock(S); continues– T2 → Preempts T3

• T2 → Lock(R); continues– T1 → Preempts T2

• T1 → Lock(R); blocks– T2 → Lock(S); blocks– T3 → Continues until unlock(S)– T2 → Continues until unlock(S) && unlock(R)– T1 executes until finished

T2 & T3 have now gained higher priority over T1

Priority Inheritance Protocol●PIP eliminates priority inversion problem●Increases the priority of a task to the maximum priority task waiting for the locked resource

● i.e. If a lower priority task T(k) has a lock on a resource required by a higher priority task T(h), then the priority of the lower task is increased to the priority of the higher task

● Once the lock is released the task resumes back its original priority

Priority Ceiling Protocol● Each resource lock is assigned a priority

ceiling, which is the priority equivalent to the highest priority task which may lock the resource.

● PCP eliminates chain blocking● A task can acquire a lock on resource lock S

only if no other task holds a lock on resource R. Thus higher priority tasks will not be blocked through both S and R

● If a high priority task is blocked through a resource, then the task holding that resource gets the priority of the high priority task. Once the resource is released, the priority is reset back to its original

Recent Work2001 – Energy Efficient Real-Time

Scheduling● Introduced Variable Voltage Processing● Based on the Earliest Deadline First

algorithm● Algorithm:

● Considered historical processor utilization in order to adjust voltage on processor to meet real-time deadlines

● Called Slacked EDF● Energy Savings of 53%

Recent Work2011 – Dynamic Voltage and Frequency

Scaling for RT Scheduling on Prioritized SMT Processor

● Introduced Task Migration across processors ● Utilized system heuristics to determine

voltage and frequency● Algorithm:

● Reduces power consumption up to 30%

Recent Work2011 – Global EDF-based Energy Efficient

Real-Time Scheduling in Multicore Platforms

● Most Real-time algorithms assume Worst Case Execution Time (WCET)

● Proposed Average Case with “Slack Time”● Algorithm:

● Uses slacktime to adjust frequency of processor during off-peak usage

● Energy savings ~10%

Future Work2011 – More Efficient Energy Efficient

Distributed/Parallel Real-time Algorithms● Algorithms considering Aperiodic task

scheduling across multiple processor systems.

References● Chow, Randy, et. al.,Distributed Operating

Systems & Algorithms, Addison Wesley, March 18, 1997

● Sinha, A.; Chandrakasan, A.P., Energy Efficient real-time scheduling, 2001

● Fujii, K.; Chishiro, H.; Matsutani, H.; Yamasaki, N., Dynamic Voltage and Frequency Scaling for Real-time Scheduling on a Prioritized SMT Processor, 2011

● Zhang, D.; Chen, F.; Jin, S., Global EDF-based Online, Energy-efficient Real-time Scheduling in Multi-core Platform, 2011


Recommended