Date post: | 14-Jan-2016 |
Category: |
Documents |
Upload: | jordan-warner |
View: | 217 times |
Download: | 0 times |
Resource Augmentation for Performance Guarantees in Embedded Real-time Systems
Abhilash ThekkilakattilLicentiate Thesis PresentationVästerås, November 30, 2012
Real-time tasks
Dependable Real-time Systems
web images
Timing characteristics of the physical components
Fault tolerance requirements
Event occurrences:periodic and sporadic
Periodic and Sporadic Real-time Tasks
job1 job2
Worst Case Execution Time
(Min/Exact) Inter-arrival time
Release time
Relative deadline
Task worst case execution time scales with processor frequency
Assumption: probabilistic task release times for sporadic tasks
Real-time Scheduling Real-time scheduling: guarantee task completions before their deadline
Non-preemptive Scheduling
Low runtime overhead Increased blocking times: low utilization Mutual exclusion by construction
Preemptive Scheduling
Ability to achieve high utilization Preemption costs Need for synchronization protocols
high priority
low priority
preemption costhigh priority
low priority
blocking
Limited Preemption Scheduling
Best of preemptive and non-preemptive: preempt only when necessary
high priority
low priority
Bounded non-preemptive region
preemption cost
Preemption Related Overheads
● Context switch related overheads: Overhead involved in saving and retrieving the context of the preempted
task
● Cache related preemption delays Overhead involved in reloading cache lines Order of 100s of micro-seconds Vary with the point of preemption Increased bus contention
● Pipeline related overheads Clear the pipeline upon preemption Refill the pipeline upon resumption
CPU frequency:
P: Power consumptionC: Effective capacitanceV: Applied voltageF: CPU frequency
Processor power consumption:
min max
CPU frequencyCPU frequencyCPU frequencyCPU frequencyCPU frequencyCPU frequency CPU frequency
Frequency Scaling in Modern Processors
Hypothesis:
Processor speed-up can be used to provide non-preemption guarantees
Research Questions
Q1: How can we control preemptions in periodic real-time task systems using CPU frequency scaling?
Q2: How can we control preemptions in sporadic real-time task systems using CPU frequency scaling when the probabilities of the task releases are known?
Research Contributions- Question 1
Q1: How can we control preemptions in periodic real-time task systems using CPU frequency scaling?
Paper A: Reducing the Number of Preemptions in Real-Time Systems Scheduling by CPU Frequency Scaling, Abhilash Thekkilakattil, Anju S Pillai, Radu Dobrin, Sasikumar Punnekkat, The 18th International Conference on Real-Time and Network Systems, Toulouse, France, November, 2010
Overview:
1.Offline preemption identification
2.Preemption elimination Calculate the minimum frequency required to eliminate the preemption Analyze the effect of preemption elimination on the rest of the schedule
3. Iteration: until no more preemptions can be eliminated
Preemption Elimination: Periodic Tasks
C=1 C=4
D starts earlier
C=1
C=2
4 8 12 16 20 24 28 32 36 400
4 8 12 16 20 24 28 32 36 400
4 8 12 16 20 24 28 32 36 400
4 8 12 16 20 24 28 32 36 400
Task
A
B
C
D
Rate monotonic schedule
Modes M1 M2 M3
Frequency (Hz)
100 150 300
FC1=6F1=600 Hz FC1=1.5F1=150 Hz
FD1=4F1=400 Hz
FC2=3F1=300 Hz
WCET Period
1 4
2 8
6 20
4 40
Task 1 2 3 4 5 6 7 8 9
A 100 100 100 100 100 100 100 100 100
B 100 100 100 100 100 - - - -
C 100 100 - - - - - - -
D 100 - - - - - - - -
10
100
-
-
-
150 300
Task instance frequencies (Hz)Processor modes
Before elimination: 7After step 1: 7After step 2: 4After step 3: 4After step 4: 2
Overview:
1.Offline Phase Determine permitted deviations in the minimum inter-arrival times of the tasks
using probabilities
2.Online Phase Online preemption control algorithm Speed-up busy period before a preemption
Research Contributions- Question 2
Q2: How can we control preemptions in sporadic real-time task systems using CPU frequency scaling when the probabilities of the task releases are known?
Paper B: Probabilistic Preemption Control using Frequency Scaling for Sporadic Real-time Tasks, Abhilash Thekkilakattil, Radu Dobrin, Sasikumar Punnekkat, The 7th IEEE International Symposium on Industrial Embedded Systems, Karlsruhe, Germany, June, 2012
Preemption Elimination: Sporadic Tasks
Task WCET Inter-arrival time
A 1 5
B 3 7
C 3 20
5 10
5 10
5 10
A
B
C
Original Rate Monotonic Schedule
Offline Phase
Task WCET Time period
Relaxation to min. inter-arrival times for threshold probability
=0.20
Relaxation to min. inter-arrival times for threshold probability
=0.24
A 1 5 1 3
B 3 7 1 3
C 3 20 1 3
0 2 4 5 6 7 8 9 10
0.04
0.08
3
0.24
1
0.20
0.020.040.04
0.080.080.1
0.08
(time)
Tas
k re
leas
e pr
obab
ility
Online Phase
Task WCET Inter-arrival time
Relaxation
A 1 5 1
B 3 7 1
C 3 20 1
5 10
5 10
5 10
A
B
C
C = CA + CB + CC = 7t = 6 (since we use release time probabilities)
Speed = 7/6
We speed-up to max. speed: simplicity
earliest possible preemption point earliest possible preemption point
C = CB = 3 t = 1Speed = 3/1
Summary: Paper A and B
Manipulate processor speed to control the task preemptive behavior
Requires no significant modifications to the schedulerRequires no significant modifications to the task attributesTrade-offs: energy vs. number of preemption Effective: significant preemption reduction shown in simulations Limitations: increased energy consumption
“There is more to life than simply increasing its speed.”
Mahatma Gandhi
What is the bound on the required speed-up?
Resource Augmentation
Introduced by B. Kalyanasundaram and K. Pruhs, “Speed is as powerful as clairvoyance,” Journal of ACM, 2000.
How good is any given online scheduler when compared to an all powerful malevolent adversary?
- Efficiency or ‘goodness’ of the scheduler
Give more resources to the scheduler to satisfy the goal function– Most commonly considered resource: processor (speed-up)
Is the speed-up required bounded (affordable)?
Previous work: upper-bounds on the speed-up to,– Ensure optimal performance for non-clairvoyant online schedulers compared to a
clairvoyant scheduler (Kalyanasundaram et. al)– Guarantee FPS schedulability for all feasible task sets (Baruah et. al and Davis et. al)
Research Questions
Q1: How can we control preemptions in periodic real-time task systems using CPU frequency scaling?
Q2: How can we control preemptions in sporadic real-time task systems using CPU frequency scaling when the probabilities of the task releases are known?
Q3: What is the resource augmentation bound that guarantees the feasibility of a specified non-preemption behavior in a real-time system?
Q3: What is the resource augmentation bound that guarantees the feasibility of a specified non-preemption behavior in a real-time system?
Paper C: Quantifying the Sub-Optimality of Non-Preemptive Real-time Scheduling, Abhilash Thekkilakattil, Radu Dobrin, Sasikumar Punnekkat, Technical Report, MRTC, November, 2012
Overview:
1.Processor speed-up to guarantee specified non-preemption behavior Upper-bound of 4Li/Dmin
• Li : required length of the Non-Preemptive Region (NPR)• Dmin : shortest deadline
•Processor speed-up to guarantee non-preemptive scheduling1. Upper-bound of 4Cmax/Dmin
• Cmax : largest execution time in the task set
•Processor speed-up to bound preemption overheads Derivation of non-preemption requirements Sensitivity analysis to calculate the optimal processor speed
Research Contributions- Question 3
Resource Augmentation for Preemption Control
t
DBF(t)
DBF(t): demand bound function at ‘t’
Li: Length of the NPR
Li
S = max (DBF(t)/ (t - Li))
S ≤ t / (t - Li)
S ≤ y / (y - 1) [ y = t/Li ]
case 1: S ≤ 2 [ y ≥ 2 ] case 2: S ≤ 4 [ 1 ≤ y < 2 ] case 3: S ≤ 4Li/t [ 0 < y < 1 ]
Is S bounded ?
DBF(t)DBF(t)/S
=> S ≤ 4Li/Dmin [ t = Dmin ]
Proof in thesis
?
Preemption Behavior of Scheduling Paradigms
high priority
low priority
preemption cost
high priority
low priority
Bounded non-preemptive region
Fully preemptive scheduler
Limited preemptionscheduler
Controlling thelength of thenon-preemptive region
Unbounded number of preemptions
Requires synchronization protocols
Bounded number of preemptions: bounded by the length of the non-preemptive regions
Control the bound on the number of preemptions
May require synchronization protocols
Does not require synchronization protocols
Bounded non-preemptive region
high priority
low priority
Bounding Preemption Costs
non-preemptive region (bounded length Q iS)
No. of preemptions pi (processor speed: S)
Enable preemptions at optimal preemption points
Executing critical sections within non-preemptive regions
high priority
low priority
Step 2. Perform sensitivity analysis to calculate the optimal processor speed
Step 1. Derive non-preemption requirements to control preemption related overheads
What does the processor speed-up bound mean?
Feasibility of Real-time Tasks
Feasibility: Does a schedule that guarantees no deadline misses exist for a given real-time task set?
Preemptive EDF: optimal uni-processor scheduling algorithm
Non-preemptive EDF (non-idling): optimal non-preemptive scheduling algorithm
How good is non-preemptive scheduling when compared to uni-processor optimal preemptive scheduling algorithms such as EDF?
Set of uni-processor feasible task sets
Set of limited preemption feasible task set on a uni-processor
Set of non-idling non-preemptive feasible task sets on a uni-processor
1
4Cmax/Dmin
4L/Dmin
The Feasibility Bucket
We can quantify the ‘goodness’ or sub-optimality of non-preemptive scheduling in terms of the processor speed-up required to guarantee a fully non-preemptive schedule for the uni-
processor feasible task sets.
Set of uni-processor feasible task sets
Set of limited preemption feasible task set on a uni-processor
Set of non-idling non-preemptive feasible task sets on a uni-processor
Speed at which all uni-processor feasible task sets are guaranteed a non-preemptive execution for L units
Speed at which all uni-processor feasible task sets are guaranteed a fully non-preemptive schedule (under non-idling paradigm)
Slower
Processor Speed
faster
Summary: Paper C
Guarantee specified preemption behavior
• Upper-bound on the required speed-up
Sub-optimality of non-preemptive scheduling• Resource augmentation bound for non-preemptive scheduling
• If there exists a scheduling algorithm that can schedule a given set of real-time tasks on a uni-processor, then non-preemptive EDF can schedule it, if given a processor that is 4Cmax/Dmin times faster
Method to bound preemption related costs• Derive corresponding non-preemption requirements
• Sensitivity analysis based method to find the required optimal speed-up
We have addressed the problem of providing non-preemption guarantees in a real-time system using processor speed-up.
“Failure is simply the opportunity to begin again, this time more intelligently.”
Henry Ford
…which is exactly the design philosophy behind fault tolerant real-time systems that uses temporal redundancy.
Fault Tolerant Real-time Scheduling
Temporal redundancy under transient faults
Fault tolerance related overhead
Fault tolerance feasibility (FT-feasibility): existence of a real-time schedule that is fault tolerant under a specified fault hypothesis
• Transient faults• Temporal redundancy
Guaranteeing FT-feasibility: ensure sufficient slack for at least one successful execution of all the tasks
• Control fault tolerance related overheads• Control task execution times
Fault Tolerance Feasibility
Nature of errors- Normally continuous events e.g., a vehicle passing through electromagnetic fields
- Occur continuously over a period of time: error bursts
Challenging to handle in classical FT-feasibility analysis- Need to map continuous events into singleton events
How can we guarantee FT-feasibility under error bursts?- Hypothesis: use a faster processor
faults/errors as singleton events
error burst
traditional FT-feasibility analysis
Research Questions
Q1: How can we control preemptions in periodic real-time task systems using CPU frequency scaling?
Q2: How can we control preemptions in sporadic real-time task systems using CPU frequency scaling when the probabilities of the task releases are known?
Q3: What is the resource augmentation bound that guarantees the feasibility of a specified non-preemption behavior in a real-time system?
Q4: What is the resource augmentation bound that guarantees the fault tolerance feasibility in real-time systems under error bursts?
Q4: What is the resource augmentation bound that guarantees the fault tolerance feasibility in real-time systems under error bursts?
Paper D: Resource Augmentation for Fault-Tolerance Feasibility of Real-time Tasks under Error Bursts, Abhilash Thekkilakattil, Radu Dobrin, Sasikumar Punnekkat and Huseyin Aysan, The 20 th International Conference on Real-time and Network Systems (shortlisted for best paper award), ACM, Pont à Musson, France, November, 2012
Overview:
1.Fault tolerance feasibility (FT-feasibility) analysis Builds on the optimality of EDF to schedule real-time tasks Derive a sufficient condition for FT-feasibility
2.Resource augmentation bounds to guarantee FT-feasibility Processor speed-up to make up for the slack deficit to enable temporal
redundancy Upper-bound (error burst length ≤ Dmin/2): 6 Upper-bound (general case): 3y/(y-1), y=t/error burst length
Research Contributions- Question 4
Problem Description
Questions:
●How can we perform an FT-feasibility analysis for a given set of temporally redundant real-time tasks under a specified error burst length?
●If the real-time task set is not found to be FT-feasible, what is the lowest processor speed that guarantees its FT-feasibility under the error burst?
Definitions
t
Tlength
worst case error overhead (Et)
ε
Worst Case Temporal Wastage (Werr(t))
=maximum wasted execution time
∑wasted execution time
ε Tlength
Assumptions
● Scheduler: Fault Tolerant Earliest Deadline First (FT-EDF)- schedule task executions and re-execution according to their deadlines
● Objective: find the Worst Case Temporal Wastage at time t- Break down into cases
● Strategy: we assume that there are no deadline misses under the error burst and derive the sufficient condition for this to be true
t’t
abs. deadline of τi
Error detection
τi
Case 1
τi
τj
τk
t’ t
τi
τj
τk
t’ t
τi
τj
τk
t’ t
Worst Case Temporal Wastage at t when the error burst hits only a single job
scenario A: Werr(t)=2(Ck – ε)
scenario B: Werr(t)= 2(Cj – ε)
scenario C: Werr(t)= 2(Ci – ε)
ε
Case 2
ε
ε
ε
τi
τj
τk
τl
t’ t
ε
Tlength
Worst Case Temporal Wastage at t when the error burst hits more than one job
(Cl – ε)
(Ck – ε)
(Cj – ε)
(Ci – ε) (Ci – ε)
Werr(t) = 2(Ci – ε) + ∑ (Cm – ε) , Dm ≤ Di
Case 3
t’t dk
overhead at dk = overhead at toverhead at dk = overhead at d(k-1)
Under EDF, the tasks released in the interval [t’,t] having a deadline greater than t are not hit by the error burst
τj
τi
Worst Case Temporal Wastage at the absolute deadline of a job that is not hit by the error burst
(abs. deadline of τi)
d(k-1)
Worst Case Temporal Wastage: General Case
Werr(t) = Max
Case 3 : WCTW at the previous absolute deadline•If τi is not hit by the error burst
Case 1 : max{2(Ck – ε)} , Dk ≤ Di
•When the error burst hits only a single job
Case 2 : 2(Ci – ε) + ∑ (Ck – ε) , Dk ≤ Di
•When the error burst hits more than one job
t is the absolute deadline of a task τi
FT-Feasibility: A Sufficient Condition
DBF(t)Tlength
t
Et
Et + DBF(t) ≤ t
Et = Werr(t) + Tlength
Problem Description
Questions:
●How can we perform an FT-feasibility analysis for a given set of temporally redundant real-time tasks under a specified error burst length?
●If the real-time task set is not found to be FT-feasible, what is the lowest processor speed that guarantees its FT-feasibility under the error burst?
Resource Augmentation for FT-feasibility
t
DBF(t)deadline miss
Tlength
S = max{(DBF(t)+ Werr(t) )/ (t -Tlength)}
Is S bounded ?
X + Y’ = Werr(t) /S
S ≤ 6 [ y ≥ 2 => Tlength ≤ Dmin/2 ]
X + Y = Werr(t)
DBF(t)DBF(t)/S
Put Werr(t) = 2DBF(t) and DBF(t) = t
S ≤ 3t/(t - Tlength )
S ≤ 3y/(y-1) [ y = t/ Tlength ]
Summary: Paper D
Fault tolerance feasibility analysis of real-time tasks●A sufficient condition for FT-feasibility
Resource augmentation bounds for FT-feasibility
●Speed-up ≤ 6 if Tlength ≤ Dmin/2
●If there exists a scheduling algorithm that can schedule a given set of real-time tasks on a uni-processor, under an error burst whose length is ≤ Dmin/2, then FT-EDF can schedule it, if given a processor that is 6 times faster.
Conclusions
Main contributions
• Preemption control method using processor speed-up
•Offline method for periodic tasks
•Combined offline-online method for sporadic tasks
• Guarantee specified preemption behavior
•Bounds on the required processor speed-up
•Method to bound the preemption related overheads in the schedule
• A sufficient condition for FT-feasibility
• Bounds on the required processor speed-up that guarantees FT-feasibility
• Quantification of the sub-optimality of non-preemptive scheduling
Future Work
● Extensions to multi-processor scheduling- Non-preemption guarantees
- FT-feasibility
● Utilization based tests- Non-preemptive scheduling
- Fault Tolerance
● Contracts for component based real-time systems- Processor speed-up for non-preemption and FT-feasibility guarantees
● Notion of feasibility: augment the notion of feasibility with the extra resources required
- E.g., Feasibility on m number of speed-s processor
- Presence of runtime overheads
…indeed there is more to life than simply increasing its speed.
Thank You !
Questions ?