Rate Monotonic Analysis. Rob Oshana Southern Methodist University. Scheduling policies for realtime systems. Scheduling Policies in RT systems. Two general categories fixed or static scheduling policies dynamic scheduling policies
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Rate Monotonic Analysis
Rob Oshana
Southern Methodist University
Scheduling policies for realtime systems
Examples of periodic tasks
Periodic Arrivals with Fixed Cost of Processing
4
4
4
 10 
periodic arrivals. period T = 10
System Utilization = C/T = .40
System will be able to meet all deadlines. It can finish processing arrivals before the next arrival occurs.
Can a second periodic event be accommodated?
4
4
4
 10 
1. periodic arrival, period T = 10 and C=4
2. periodic arrival, T=10 and C=3 ??
Can a second periodic event be accommodated?
4
4
4
 10 
1. periodic arrival, period T = 10 and C=4
2. periodic arrival, T=10 and C=3 ??
System Utilization C/T = .70
How about 2nd periodic event with T=6 and C=3?
4
4
4
 10 
1. periodic arrival, period T = 10 and C=4
2. periodic arrival, T=6 and C=3 ??
How about 2nd periodic event with T=6 and C=3?
4
4
4
 10 
1. periodic arrival, period T = 10 and C=4
2. periodic arrival, T=6 and C=3 ??
System Utilization C/T = .90
Task #1
Task #2
6
4
4
4
 10 
Event #2
Event #1
If we process Event #1 before Event #2 then,
2nd event processing will not complete before the next comparable event occurs
Can’t Meet Deadline!
Task #1
Task #2
6
4
 10 
Try Event #2 before Event #1
We still cannot complete task 1 before the next task 2 event occurs at t=6
unless...
Event #2
Event #1
Task #1
Task #2
6
4
 10 
Try Event #2 before Event #1
We still cannot complete task 1 before the next task 2 event occurs at t=6
unless…we Interrupt task 1
Event #2
Event #1
Task #1
Task #2
6
4
 10 
Try Event #2 before Event #1
We still cannot complete task 1 before the next task 2 event occurs at t=6
unless…we Interrupt task 1
Event #2
Giving event #2 priority means that we can meet our deadline IF we preempt the processing of event #1 when event #2 occurs
Event #1
Rate Monotonic Analysis
TaskCiTiUi
1310.30
2312.25
3416.25
4720.35
ExampleCan these 4 tasks be scheduled?
TaskCiTiUi
1310.30
2312.25
3416.25
4720.35
TaskCiTiUi
1620.30
2416.25
3312.25
Can these tasks always meet their deadlines?
Total Utilization = 80%
It MAY be possible  Rate Monotonic Scheduling applies!
TaskCiTiUi
1220.10
2416.25
3312.25
4120.05
Are These Tasks Schedulable?
TaskCiTiUi
1220.10
2416.25
3312.25
4120.05
Yes. Total CPU Utilization is 65% < 69%
Are These Tasks Schedulable?
TaskCiTiUi
1220.10
2416.25
3312.25
4320.15
Are These Tasks Schedulable?
TaskCiTiUi
1220.10
2416.25
3312.25
4120.05
Total CPU Utilization is 65%
???
Priority Inversion
Taskh
Taskmed
Tasklow
Priority
inversion
Normal
execution
Execution in
critical section
Unbounded Priority Inversion
Taskh
Uncontrolled priority inversion
Taskmed
Taskmed
Tasklow
Priority
inversion
Normal
execution
Execution in
critical section
Motor Drive
Motor
Tach
RS232 Data Out
Requirements
Control motor speed (1 Khz sampling rate – dV/dT)
Accept keyboard commands to control the motor, change the display, or send data out the
RS232 port
Drive a simple display and refresh 2 times per second
Send data out the RS232 port when there is nothing else to do
Motor
Motor
Control
Motor
DAC
control
ADC
Tach
algorithm
Drive
Keypad
Keypad
System
control
Control algorithm
control
Display
Display
Display interface
algorithm
control
Remote
Remote
McBSP
RS

232
algorithm
output
Task
Rate
Priority
Periodic or
Activation
aperiodic
mechanism
Motor control
1 kHz
1
Periodic
Hardware Interrupt
Keypad
5 hertz
2
Aperiodic
Hardware Interrupt
control
Display
2 hertz
3
Periodic
Software interrupt
control
Remote output
Background
4
Aperiodic
Idle loop (runs
l
continuously in the
background)
Clock source
Periodic clock
Periodic functions
n ticks
tick
DSP
Motor control
timer
DSP function
Periodic
Selectable
Function
source
m ticks
manager
Display control
DSP function
tick
User
Defined
clocking
What Happened on Mars ?
low priority 
infrequent execution
medium priority
high priority 
frequent execution
meteorological
data
gathering
task
bus
management
task
communication
task
mutex
information bus
What happened on Mars ?
What happened on Mars ?
What happened on Mars ?