SlideShare a Scribd company logo
Seminar System Architecture and Networking
(2IN95)
Scheduling Fixed-Priority
Tasks with Preemption
Threshold
Yun Wang Manas Saksena
Department of CSC Concordia University
Presented by
Deepak Vedha Raj Sudhakar (0925172)
01/12/2014
Agenda
➢ Scheduling Basics
➢ Goal of Real time Scheduling
➢ Classification of Scheduling algorithms
➢ Motivation for FPTS
➢ Preemptive Vs Non Preemptive Scheduling
➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS)
➢ Motivating example
➢ Schedulability Analysis
➢ Worst Case Response time
➢ Critical Instant
➢ Level - I active period
➢ Algorithms to find optimal thresholds
➢ Algorithm to find optimal priorities and thresholds
➢ Conclusion
2
Scheduling Basics
System Resources
➢ CPU time
➢ Memory
➢ I/O (access to devices)
➢ Network resources
➢ Energy
S
C
H
E
D
U
L
E
R
USER 1
USER 2
USER 3
USER N
.
.
3
Goal of Real time Scheduling
➢ Deadlines must be met
➢ Tasks are of different importance ⇒ No fairness
➢ Short response times are not sufficient, guaranteed response
times are needed.
➢ Parameters (Period , Deadline)
4
Classification of Real time Scheduling
5
FPPS FPNS FPDS , FPTS
Agenda
➢ Scheduling Basics
➢ Goal of Real time Scheduling
➢ Classification of Scheduling algorithms
➢ Motivation for FPTS
➢ Preemptive Vs Non Preemptive Scheduling
➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS)
➢ Motivating example
➢ Schedulability Analysis
➢ Worst Case Response time
➢ Critical Instant
➢ Level - I active period
➢ Algorithms to find optimal thresholds
➢ Algorithm to find optimal priorities and thresholds
➢ Conclusion
6
Priority-based Real-time Scheduling Assumptions
➢ All tasks are periodic (periodic task model)
➢ Tasks are preemptive at any time
➢ Preemption costs nothing
➢ Context switch costs nothing
➢ Scheduling decision costs nothing
➢ Tasks are independent
➢ Resources (except CPU) are sufficient
Costly Assumptions
7
Hidden Costs
➢ Scheduling costs
➢ Pipeline costs
➢ Cache-related costs
➢ Bus related costs
WCET( i
)∝ Total number of preemptions
WCET( i
)∝ Point of preemption
8
Preemptive Vs Non Preemptive
9
Preemptive Non preemptive
Better Schedulability ratio
(Least Upper bound = 69%)
Simpler WCET analysis
No Mutual exclusion problem
Stack Sharing possible
Minimize I/O delay and jitter
Requirements for resource constrained systems
➢ Better Schedulability ( FPPS)
➢ Reduced Stack requirements (FPNS)
➢ Reduced arbitrary preemptions (FPNS)
Solution : Limited preemptive Fixed Priority Scheduling
10
FPTS
11
θi
>= πi
θi
= πi
-> FPPS
θi
= πi
(max) -> FPNS
FPPS - Not Schedulable
12
Task Ci Ti Di Pi WCRT
T1 20 70 50 3 20
T2 20 80 80 2 40
T3 35 200 100 1 115
FPNS - Not Schedulable
13
Task Ci Ti Di Pi WCRT
T1 20 70 50 3 55
T2 20 80 80 2 75
T3 35 200 100 1 75
FPTS - Schedulable
14
Task Ci Ti Di Pi θi
WCRT
T1 20 70 50 3 3 40
T2 20 80 80 2 3 75
T3 35 200 100 1 2 95
Agenda
➢ Scheduling Basics
➢ Goal of Real time Scheduling
➢ Classification of Scheduling algorithms
➢ Motivation for FPTS
➢ Preemptive Vs Non Preemptive Scheduling
➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS)
➢ Motivating example
➢ Schedulability Analysis
➢ Worst Case Response time
➢ Critical Instant
➢ Level - I active period
➢ Algorithms to find optimal thresholds
➢ Algorithm to find optimal priorities and thresholds
➢ Conclusion
15
Schedulability Test
Task set is Schedulable if all tasks meet their deadlines
Condition : WCRT(Ti)<= D(i)
Question: How to determine WCRT(Ti)?
16
Response Time
Question: How to determine WCRT(Ti)?
Solution: Identify Critical Instant of task(Ti)
17[1] “Fig 8.7:Hard Real-Time Computing Systems by Giorgio C. Buttazzo”
Response time = ←------------Blocking time--------------------->+<------------------ Interference Time ------------->
Ph
= Priority
θi
= Threshold
Task Ci Ti Di Pi θi
T1 20 70 50 3 3
T2 20 80 80 2 3
T3 35 200 100 1 2
Critical Instant
Critical Instant results in
Maximum block time + Maximum interference time
18
Critical instant(T3) = Time when task T3 arrives at the same time as task T1 and task T2
Critical instant(T2) = Time when task T2 arrives at the same time as task T1 and task T3 just
started executing prior to arrival of task T2.
Critical instant(T1) = Time when task T3 just started executing prior to arrival of task T1
Critical Instant of Task 3
19
Question:
Does the first task instance
after critical instant
correspond to the worst case
response time of the task?
Answer : Not always
Self Pushing Mechanism
20
WCRT(T3) does not occur at first instance.
[1] “Fig 8.7:Hard Real-Time Computing Systems by Giorgio C. Buttazzo”
Level-I Active period
Question: How many task instances should I consider after
critical instant?
Answer: All instances in the Level-I Active period should be
considered
21
Level-I Active period
Level-I active period : Interval [a,b) for which level -I pending
workload (>=Pi) is positive. Null at a and b.
22
Level-I active
period
At t= 0-Δ , W1
p
(0-Δ) = 0
At t= 0 , W1
p
(0) > 0
At t= 10 , W1
p
(0) > 0
At t= 20 , W1
p
(0) > 0
At t= 40 , W1
p
(0) = 0
Schedulability test (Recap)
For all tasks (i=1 to n) do
Step 1 : Identify critical instant of task(i)
Step 2: Find Level-I active period of task(i)
Step 3: Determine WCRT(i)
Step 4: Check WCRT(i)<= D(i)
23
WCRT(T1)
Level-I active period
24
L1
(0) = C1
+ B1
= 20 + 20 = 40
L1
(1) = B1
+∑h:Ph>=1
⌈L1
(0)/Th
⌉ *Ch
= 20 + ⌈ 40/70⌉ * 20
= 40
L1
(0) = L1
(1) - Stop
WCRT(T1) = (finish time) F1
- Arrival time
= 40 - 0 = 40
Level-I
active
period
WCRT(T2)
25
Level-I active period
L2
(0) = C2
+ B2
= 20+ 35 = 55
L2
(1) = B2
+∑h:Ph>=2
⌈L2
(0)/Th
⌉ *Ch
= 35 + ⌈ 55/70⌉ * 20 + ⌈ 55/80⌉ * 20
= 75
L2
(2) = B2
+∑h:Ph>=2
⌈L2
(1)/Th
⌉ *Ch
= 35 + ⌈ 75/70⌉ * 20 + ⌈ 75/80⌉ * 20
= 95
L2
(3) = B2
+∑h:Ph>=2
⌈L2
(2)/Th
⌉ *Ch
= 35 + ⌈ 95/70⌉ * 20 + ⌈ 95/80⌉ * 20
= 115
L2
(4) = B2
+∑h:Ph>=2
⌈L2
(3)/Th
⌉ *Ch
= 35 + ⌈ 115/70⌉ * 20 + ⌈ 115/80⌉ * 20
= 115
L2
(3) = L2
(4) - Stop
WCRT(T2) = max{ RT(instance1) ,RT(instance2) }
= max { 75 , 35} = 75
WCRT(T3)
26
Level-I active period
Level-I active period
interval = [0 , 115)
WCRT(T3) = 95
Formula : Worst case response time
Computing Start time
Computing Finish time
Computing Worst case Response time
27
Agenda
➢ Scheduling Basics
➢ Goal of Real time Scheduling
➢ Classification of Scheduling algorithms
➢ Motivation for FPTS
➢ Preemptive Vs Non Preemptive Scheduling
➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS)
➢ Motivating example
➢ Schedulability Analysis
➢ Worst Case Response time
➢ Critical Instant
➢ Level - I active period
➢ Algorithm to find optimal thresholds
➢ Algorithm to find optimal priorities and thresholds
➢ Conclusion
28
Algorithm : Optimal Minimum Threshold assignment
Goal : Find minimum threshold assignment for a task set if one
exists
29
Algorithm
Taskset T = { Ci Ti Di Pi),
∀ i
∊ T
Task set Feasible or
not?
Threshold θi
∀ i
∊ T
Algorithm : Flowchart
30
Complexity : O
(n2
)
Algorithm : Example
Start from lowest priority task - T3
31
Task Ci Ti Di Pi θi
WCRT
T1 20 70 50 3 3 20
T2 20 80 80 2 2 40
T3 35 200 100 1 1 115
Algorithm : Example
Increase threshold of task T3 from 1 to 2.
Meets deadline , assign threshold θ3
= 2
32
Task Ci Ti Di Pi θi
WCRT
T1 20 70 50 3 3 20
T2 20 80 80 2 2 95
T3 35 200 100 1 2 95
Algorithm : Example
Increase threshold of task T2 from 2 to 3.
Meets deadline , assign threshold θ2
= 3
33
Task Ci Ti Di Pi θi
WCRT
T1 20 70 50 3 3 40
T2 20 80 80 2 3 75
T3 35 200 100 1 2 95
Algorithm : Example
Meets deadline , assign threshold θ1
= 3
34
Task Ci Ti Di Pi θi
WCRT
T1 20 70 50 3 3 40
T2 20 80 80 2 3 75
T3 35 200 100 1 2 95
Agenda
➢ Scheduling Basics
➢ Goal of Real time Scheduling
➢ Classification of Scheduling algorithms
➢ Motivation for FPTS
➢ Preemptive Vs Non Preemptive Scheduling
➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS)
➢ Motivating example
➢ Schedulability Analysis
➢ Worst Case Response time
➢ Critical Instant
➢ Level - I active period
➢ Algorithm to find optimal thresholds
➢ Algorithm to find optimal priorities and thresholds
➢ Conclusion
35
Algorithm : Optimal Priority and Threshold
assignment
Goal : Find optimal priority and minimum threshold assignment
for a task set if one exists.
36
Algorithm
Taskset T = { Ci Ti Di),
∀ i
∊ T
Task set Feasible or
not?
Priority Pi
∀ i
∊ T
Threshold θi
∀ i
∊ T
Algorithm : Optimal Priority and Threshold
assignment
37
Algorithm : Optimal Priority and Threshold
assignment
38
Algorithm : Example
TaskSet T = {T 1 , T2 , T3} Priority Ordered TaskSet = {}
Priority P = { 1, 2 , 3 }
39
Task Ci Ti Di Pi θi
WCRT
T1 20 70 50
T2 20 80 80
T3 35 200 100
Algorithm : Example
TaskSet T = {T 1 , T2 , T3} Priority Ordered TaskSet = {}
Priority P = { 1, 2 , 3 }
40
Task Ci Ti Di Pi θi
WCRT Lateness
WCRT (i)- Di
T1 20 70 50 1 55 5
T2 20 80 80
T3 35 200 100
Algorithm : Example
TaskSet T = {T 1 , T2 , T3} Priority Ordered TaskSet = {}
Priority P = { 1, 2 , 3 }
41
Task Ci Ti Di Pi θi
WCRT Lateness
WCRT (i)- Di
T1 20 70 50
T2 20 80 80 1 95 15
T3 35 200 100
Algorithm : Example
TaskSet T = {T 1 , T2 , T3} Priority Ordered TaskSet = {}
Priority P = { 1, 2 , 3 }
Sorted List = {T 1 , T2 , T3} (Ascending Lateness - { 5, 15 , 15} )
Refine (Sorted List) = {T2,T3}
// prune infeasible path ( T1 -> P1
= 1 , θ1
= 3)
42
Task Ci Ti Di Pi θi
WCRT Lateness
WCRT (i)- Di
T1 20 70 50
T2 20 80 80
T3 35 200 100 1 115 15
Algorithm : Example
TaskSet T = {T 1 , T3} Priority Ordered TaskSet = { T2(1)}
Priority P = { 2 , 3 }
43
Task Ci Ti Di Pi θi
WCRT Lateness
WCRT (i)- Di
T1 20 70 50 2 55 5
T3 35 200 100
Algorithm : Example
TaskSet T = {T 1 , T3} Priority Ordered TaskSet = { T2(1)}
Priority P = { 2 , 3 }
44
Task Ci Ti Di Pi θi
WCRT Lateness
WCRT (i)- Di
T1 20 70 50
T3 35 200 100 2 55 -45
Algorithm : Example
TaskSet T = {T1} Priority Ordered TaskSet = { T3(2),T2(1)}
Priority P = { 3 }
45
Task Ci Ti Di Pi θi
WCRT Lateness
WCRT (i)- Di
T3 35 200 100
Algorithm : Example
TaskSet T = {T1} Priority Ordered TaskSet = { T1(2),T2(1)}
Priority P = { 3 }
46
Task Ci Ti Di Pi θi
WCRT Lateness
WCRT (i)- Di
T1 20 70 50 3 20 30
Algorithm : Optimal Priority ordering
TaskSet T = {} Priority Ordered TaskSet = { T1(3),T3(2),T2(1) }
Priority P = {}
47
Task Ci Ti Di Pi θi
WCRT
T1 20 70 50 3
T2 20 80 80 1
T3 35 200 100 2
Algorithm : Optimal Priority and Threshold
assignment
48
1 {T1(3), T3(2), T2(1)}
2 {T1(1), T3(2), T2(3)}
3 {T1(1), T2(2) , T3(3)}
4 {T1(3), T2(2), T3(1)}
5 {T1(2), T2(3), T3(1)}
6 {T1(2), T2(1), T3(3)}
Missing Information
➢ Next Priority ordering selection information missing.
➢ Algorithmic Complexity not mentioned. Exponential
➢ Task ordering when heuristics value matches?
➢ Experimental Results showing advantages of FPTS missing
➢ Minimal threshold assignment algorithm does not limit the
preemptions
49
Agenda
➢ Scheduling Basics
➢ Goal of Real time Scheduling
➢ Classification of Scheduling algorithms
➢ Motivation for FPTS
➢ Preemptive Vs Non Preemptive Scheduling
➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS)
➢ Motivating example
➢ Schedulability Analysis
➢ Worst Case Response time
➢ Critical Instant
➢ Level - I active period
➢ Algorithm to find optimal thresholds
➢ Algorithm to find optimal priorities and thresholds
➢ Conclusion
50
Conclusion
➢ Limitation of Preemptions
➢ Why Limited Fixed priority scheduling techniques?
➢ How to perform Schedulability test by determining WCRT?
➢ Find minimum thresholds given priorities of the task set
➢ Find optimal priorities and feasible threshold assignment for
task set
51
References
1. Hard Real-Time Computing Systems by Giorgio C. Buttazzo
2. Y. Wang and M. Saksena. “Scheduling fixed-priority tasks with preemption threshold”. In Proc. 6th IEEE
Real-Time Computing Systems and Applications (RTCSA), pages 328–335, Dec. 1999.
3. Reinder J. Bril and Johan J. Lukkien Wim F.J. Verhaegh “Worst-case response time analysis of real-time
tasks under fixed-priority scheduling with deferred preemption revisited “ , TU/e, CS-Report 06-34,
December 2006
4. K. W. Tindell , A. Burns , A. J. Wellings, An extendible approach for analyzing fixed priority hard real-time
tasks, Real-Time Systems, v.6 n.2, p.133-151, March 1994
5. Buttazzo, G.C. ; Scuola Superiore Sant'anna, Pisa, Italy ; Bertogna, M. ; Gang Yao , Limited Preemptive
Scheduling for Real-Time Systems. A Survey . In Industrial Informatics, I,05 March 2012
6. N. Audsley. Optimal priority assignment and feasibility of static priority tasks with arbitrary start times.
Technical Report YCS 164, Department of Computer Science, University of York, England, Dec. 1999
52
Thank You for your Attention
Any Questions ?
53
Questions
1. Why is the worst case response time calculated as the maximum response time of the jobs in the Level-i active period?
2. How do you determine / measure the least upper bound utilisation schedulability criteria for FPTS?
3. What is the additional costs incurred by optimal priority and preemption threshold assignment algorithm? How does it
compare to the preemption costs incurred by FPPS?
4. Is the optimal priority and preemption threshold assignment done in static or dynamic manner?
5. How efficient it is for resource constrained set up ?
6. What is the difference between level-i active and level-i busy period?
7. FPTS increases schedulability of task set by combining FPPS & FPNS, but the worst case response time of some of
the tasks are increased (compared to FPDS) although they meet the deadlines.Does it have any impact on the
system?
8. What is the run-time complexity of the proposed algorithms based on task set (n)?
54
What to follow ?
Scalable real time system design using Preemption Thresholds
by Shashidhar B.L
55

More Related Content

What's hot

System Software /Operating System Lab Report
System Software /Operating System Lab ReportSystem Software /Operating System Lab Report
System Software /Operating System Lab Report
Vishnu K N
 
Algorithm And analysis Lecture 03& 04-time complexity.
 Algorithm And analysis Lecture 03& 04-time complexity. Algorithm And analysis Lecture 03& 04-time complexity.
Algorithm And analysis Lecture 03& 04-time complexity.
Tariq Khan
 
Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1
Deepak John
 
Real time-system
Real time-systemReal time-system
Real time-system
ysush
 
Chronological Decomposition Heuristic: A Temporal Divide-and-Conquer Strateg...
Chronological Decomposition Heuristic:  A Temporal Divide-and-Conquer Strateg...Chronological Decomposition Heuristic:  A Temporal Divide-and-Conquer Strateg...
Chronological Decomposition Heuristic: A Temporal Divide-and-Conquer Strateg...
Alkis Vazacopoulos
 
Daa notes 2
Daa notes 2Daa notes 2
Daa notes 2
smruti sarangi
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
Venkatesh Iyer
 
Real Time most famous algorithms
Real Time most famous algorithmsReal Time most famous algorithms
Real Time most famous algorithms
Andrea Tino
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Swapnil Agrawal
 
Process and CPU scheduler
Process and CPU schedulerProcess and CPU scheduler
Process and CPU scheduler
Shivbhawan Verma
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
swapnac12
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
Computer Hardware & Trouble shooting
 
Online Algorithms - An Introduction
Online Algorithms - An IntroductionOnline Algorithms - An Introduction
Online Algorithms - An Introduction
Amrinder Arora
 
St hack2015 dynamic_behavior_analysis_using_binary_instrumentation_jonathan_s...
St hack2015 dynamic_behavior_analysis_using_binary_instrumentation_jonathan_s...St hack2015 dynamic_behavior_analysis_using_binary_instrumentation_jonathan_s...
St hack2015 dynamic_behavior_analysis_using_binary_instrumentation_jonathan_s...
Jonathan Salwan
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
Ganesh Solanke
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)
jehan1987
 

What's hot (20)

System Software /Operating System Lab Report
System Software /Operating System Lab ReportSystem Software /Operating System Lab Report
System Software /Operating System Lab Report
 
Algorithm And analysis Lecture 03& 04-time complexity.
 Algorithm And analysis Lecture 03& 04-time complexity. Algorithm And analysis Lecture 03& 04-time complexity.
Algorithm And analysis Lecture 03& 04-time complexity.
 
Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1
 
Real time-system
Real time-systemReal time-system
Real time-system
 
Chronological Decomposition Heuristic: A Temporal Divide-and-Conquer Strateg...
Chronological Decomposition Heuristic:  A Temporal Divide-and-Conquer Strateg...Chronological Decomposition Heuristic:  A Temporal Divide-and-Conquer Strateg...
Chronological Decomposition Heuristic: A Temporal Divide-and-Conquer Strateg...
 
Daa notes 2
Daa notes 2Daa notes 2
Daa notes 2
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
 
Real Time most famous algorithms
Real Time most famous algorithmsReal Time most famous algorithms
Real Time most famous algorithms
 
20
20 20
20
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Process and CPU scheduler
Process and CPU schedulerProcess and CPU scheduler
Process and CPU scheduler
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
 
Online Algorithms - An Introduction
Online Algorithms - An IntroductionOnline Algorithms - An Introduction
Online Algorithms - An Introduction
 
OS_Ch6
OS_Ch6OS_Ch6
OS_Ch6
 
St hack2015 dynamic_behavior_analysis_using_binary_instrumentation_jonathan_s...
St hack2015 dynamic_behavior_analysis_using_binary_instrumentation_jonathan_s...St hack2015 dynamic_behavior_analysis_using_binary_instrumentation_jonathan_s...
St hack2015 dynamic_behavior_analysis_using_binary_instrumentation_jonathan_s...
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
OSCh7
OSCh7OSCh7
OSCh7
 
Mutual exclusion and sync
Mutual exclusion and syncMutual exclusion and sync
Mutual exclusion and sync
 
Algorithm analysis (All in one)
Algorithm analysis (All in one)Algorithm analysis (All in one)
Algorithm analysis (All in one)
 

Similar to Scheduling Fixed Priority Tasks with Preemption Threshold

Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
University of Computer Science and Technology
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
University of Computer Science and Technology
 
Improvement of Scheduling Granularity for Deadline Scheduler
Improvement of Scheduling Granularity for Deadline Scheduler Improvement of Scheduling Granularity for Deadline Scheduler
Improvement of Scheduling Granularity for Deadline Scheduler
Yoshitake Kobayashi
 
slides.06.pptx
slides.06.pptxslides.06.pptx
slides.06.pptx
balewayalew
 
Ch 06 - CPM PERT (1).pptx
Ch 06 - CPM  PERT (1).pptxCh 06 - CPM  PERT (1).pptx
Ch 06 - CPM PERT (1).pptx
sitinorhafizabintiab1
 
task_sched2.ppt
task_sched2.ppttask_sched2.ppt
task_sched2.ppt
SruthiReddy112
 
Cpm module iii reference
Cpm module iii referenceCpm module iii reference
Cpm module iii reference
ahsanrabbani
 
Distributed systems scheduling
Distributed systems schedulingDistributed systems scheduling
Distributed systems scheduling
Pragati Startup Presentation Designer firm
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
Shanmuganathan C
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
iqbalphy1
 
Energy power efficient real time systems
Energy power efficient real time systemsEnergy power efficient real time systems
Energy power efficient real time systems
pragya arya
 
Priority assignment on the mp so c with dmac
Priority assignment on the mp so c with dmacPriority assignment on the mp so c with dmac
Priority assignment on the mp so c with dmac
鵬 大
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
Dr. Mazin Mohamed alkathiri
 
Operating System Lab Manual
Operating System Lab ManualOperating System Lab Manual
Operating System Lab Manual
Bilal Mirza
 
Scheduling
SchedulingScheduling
Scheduling
ahmad bassiouny
 
Scheduling
SchedulingScheduling
Scheduling
ahmad bassiouny
 
Scheduling
SchedulingScheduling
Scheduling
ahmad bassiouny
 
Rate.docx
Rate.docxRate.docx
Rate.docx
kradha5
 
Real Time System
Real Time SystemReal Time System
Real Time System
AKANSH SINGHAL
 

Similar to Scheduling Fixed Priority Tasks with Preemption Threshold (20)

Real time system tsp
Real time system tspReal time system tsp
Real time system tsp
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
 
Improvement of Scheduling Granularity for Deadline Scheduler
Improvement of Scheduling Granularity for Deadline Scheduler Improvement of Scheduling Granularity for Deadline Scheduler
Improvement of Scheduling Granularity for Deadline Scheduler
 
slides.06.pptx
slides.06.pptxslides.06.pptx
slides.06.pptx
 
Ch 06 - CPM PERT (1).pptx
Ch 06 - CPM  PERT (1).pptxCh 06 - CPM  PERT (1).pptx
Ch 06 - CPM PERT (1).pptx
 
task_sched2.ppt
task_sched2.ppttask_sched2.ppt
task_sched2.ppt
 
Cpm module iii reference
Cpm module iii referenceCpm module iii reference
Cpm module iii reference
 
Distributed systems scheduling
Distributed systems schedulingDistributed systems scheduling
Distributed systems scheduling
 
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
AlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorithmsAlgorit...
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Energy power efficient real time systems
Energy power efficient real time systemsEnergy power efficient real time systems
Energy power efficient real time systems
 
Priority assignment on the mp so c with dmac
Priority assignment on the mp so c with dmacPriority assignment on the mp so c with dmac
Priority assignment on the mp so c with dmac
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Operating System Lab Manual
Operating System Lab ManualOperating System Lab Manual
Operating System Lab Manual
 
Scheduling
SchedulingScheduling
Scheduling
 
Scheduling
SchedulingScheduling
Scheduling
 
Scheduling
SchedulingScheduling
Scheduling
 
Rate.docx
Rate.docxRate.docx
Rate.docx
 
Real Time System
Real Time SystemReal Time System
Real Time System
 

Recently uploaded

AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
veerababupersonal22
 

Recently uploaded (20)

AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
 

Scheduling Fixed Priority Tasks with Preemption Threshold

  • 1. Seminar System Architecture and Networking (2IN95) Scheduling Fixed-Priority Tasks with Preemption Threshold Yun Wang Manas Saksena Department of CSC Concordia University Presented by Deepak Vedha Raj Sudhakar (0925172) 01/12/2014
  • 2. Agenda ➢ Scheduling Basics ➢ Goal of Real time Scheduling ➢ Classification of Scheduling algorithms ➢ Motivation for FPTS ➢ Preemptive Vs Non Preemptive Scheduling ➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS) ➢ Motivating example ➢ Schedulability Analysis ➢ Worst Case Response time ➢ Critical Instant ➢ Level - I active period ➢ Algorithms to find optimal thresholds ➢ Algorithm to find optimal priorities and thresholds ➢ Conclusion 2
  • 3. Scheduling Basics System Resources ➢ CPU time ➢ Memory ➢ I/O (access to devices) ➢ Network resources ➢ Energy S C H E D U L E R USER 1 USER 2 USER 3 USER N . . 3
  • 4. Goal of Real time Scheduling ➢ Deadlines must be met ➢ Tasks are of different importance ⇒ No fairness ➢ Short response times are not sufficient, guaranteed response times are needed. ➢ Parameters (Period , Deadline) 4
  • 5. Classification of Real time Scheduling 5 FPPS FPNS FPDS , FPTS
  • 6. Agenda ➢ Scheduling Basics ➢ Goal of Real time Scheduling ➢ Classification of Scheduling algorithms ➢ Motivation for FPTS ➢ Preemptive Vs Non Preemptive Scheduling ➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS) ➢ Motivating example ➢ Schedulability Analysis ➢ Worst Case Response time ➢ Critical Instant ➢ Level - I active period ➢ Algorithms to find optimal thresholds ➢ Algorithm to find optimal priorities and thresholds ➢ Conclusion 6
  • 7. Priority-based Real-time Scheduling Assumptions ➢ All tasks are periodic (periodic task model) ➢ Tasks are preemptive at any time ➢ Preemption costs nothing ➢ Context switch costs nothing ➢ Scheduling decision costs nothing ➢ Tasks are independent ➢ Resources (except CPU) are sufficient Costly Assumptions 7
  • 8. Hidden Costs ➢ Scheduling costs ➢ Pipeline costs ➢ Cache-related costs ➢ Bus related costs WCET( i )∝ Total number of preemptions WCET( i )∝ Point of preemption 8
  • 9. Preemptive Vs Non Preemptive 9 Preemptive Non preemptive Better Schedulability ratio (Least Upper bound = 69%) Simpler WCET analysis No Mutual exclusion problem Stack Sharing possible Minimize I/O delay and jitter
  • 10. Requirements for resource constrained systems ➢ Better Schedulability ( FPPS) ➢ Reduced Stack requirements (FPNS) ➢ Reduced arbitrary preemptions (FPNS) Solution : Limited preemptive Fixed Priority Scheduling 10
  • 11. FPTS 11 θi >= πi θi = πi -> FPPS θi = πi (max) -> FPNS
  • 12. FPPS - Not Schedulable 12 Task Ci Ti Di Pi WCRT T1 20 70 50 3 20 T2 20 80 80 2 40 T3 35 200 100 1 115
  • 13. FPNS - Not Schedulable 13 Task Ci Ti Di Pi WCRT T1 20 70 50 3 55 T2 20 80 80 2 75 T3 35 200 100 1 75
  • 14. FPTS - Schedulable 14 Task Ci Ti Di Pi θi WCRT T1 20 70 50 3 3 40 T2 20 80 80 2 3 75 T3 35 200 100 1 2 95
  • 15. Agenda ➢ Scheduling Basics ➢ Goal of Real time Scheduling ➢ Classification of Scheduling algorithms ➢ Motivation for FPTS ➢ Preemptive Vs Non Preemptive Scheduling ➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS) ➢ Motivating example ➢ Schedulability Analysis ➢ Worst Case Response time ➢ Critical Instant ➢ Level - I active period ➢ Algorithms to find optimal thresholds ➢ Algorithm to find optimal priorities and thresholds ➢ Conclusion 15
  • 16. Schedulability Test Task set is Schedulable if all tasks meet their deadlines Condition : WCRT(Ti)<= D(i) Question: How to determine WCRT(Ti)? 16
  • 17. Response Time Question: How to determine WCRT(Ti)? Solution: Identify Critical Instant of task(Ti) 17[1] “Fig 8.7:Hard Real-Time Computing Systems by Giorgio C. Buttazzo” Response time = ←------------Blocking time--------------------->+<------------------ Interference Time -------------> Ph = Priority θi = Threshold
  • 18. Task Ci Ti Di Pi θi T1 20 70 50 3 3 T2 20 80 80 2 3 T3 35 200 100 1 2 Critical Instant Critical Instant results in Maximum block time + Maximum interference time 18 Critical instant(T3) = Time when task T3 arrives at the same time as task T1 and task T2 Critical instant(T2) = Time when task T2 arrives at the same time as task T1 and task T3 just started executing prior to arrival of task T2. Critical instant(T1) = Time when task T3 just started executing prior to arrival of task T1
  • 19. Critical Instant of Task 3 19 Question: Does the first task instance after critical instant correspond to the worst case response time of the task? Answer : Not always
  • 20. Self Pushing Mechanism 20 WCRT(T3) does not occur at first instance. [1] “Fig 8.7:Hard Real-Time Computing Systems by Giorgio C. Buttazzo”
  • 21. Level-I Active period Question: How many task instances should I consider after critical instant? Answer: All instances in the Level-I Active period should be considered 21
  • 22. Level-I Active period Level-I active period : Interval [a,b) for which level -I pending workload (>=Pi) is positive. Null at a and b. 22 Level-I active period At t= 0-Δ , W1 p (0-Δ) = 0 At t= 0 , W1 p (0) > 0 At t= 10 , W1 p (0) > 0 At t= 20 , W1 p (0) > 0 At t= 40 , W1 p (0) = 0
  • 23. Schedulability test (Recap) For all tasks (i=1 to n) do Step 1 : Identify critical instant of task(i) Step 2: Find Level-I active period of task(i) Step 3: Determine WCRT(i) Step 4: Check WCRT(i)<= D(i) 23
  • 24. WCRT(T1) Level-I active period 24 L1 (0) = C1 + B1 = 20 + 20 = 40 L1 (1) = B1 +∑h:Ph>=1 ⌈L1 (0)/Th ⌉ *Ch = 20 + ⌈ 40/70⌉ * 20 = 40 L1 (0) = L1 (1) - Stop WCRT(T1) = (finish time) F1 - Arrival time = 40 - 0 = 40 Level-I active period
  • 25. WCRT(T2) 25 Level-I active period L2 (0) = C2 + B2 = 20+ 35 = 55 L2 (1) = B2 +∑h:Ph>=2 ⌈L2 (0)/Th ⌉ *Ch = 35 + ⌈ 55/70⌉ * 20 + ⌈ 55/80⌉ * 20 = 75 L2 (2) = B2 +∑h:Ph>=2 ⌈L2 (1)/Th ⌉ *Ch = 35 + ⌈ 75/70⌉ * 20 + ⌈ 75/80⌉ * 20 = 95 L2 (3) = B2 +∑h:Ph>=2 ⌈L2 (2)/Th ⌉ *Ch = 35 + ⌈ 95/70⌉ * 20 + ⌈ 95/80⌉ * 20 = 115 L2 (4) = B2 +∑h:Ph>=2 ⌈L2 (3)/Th ⌉ *Ch = 35 + ⌈ 115/70⌉ * 20 + ⌈ 115/80⌉ * 20 = 115 L2 (3) = L2 (4) - Stop WCRT(T2) = max{ RT(instance1) ,RT(instance2) } = max { 75 , 35} = 75
  • 26. WCRT(T3) 26 Level-I active period Level-I active period interval = [0 , 115) WCRT(T3) = 95
  • 27. Formula : Worst case response time Computing Start time Computing Finish time Computing Worst case Response time 27
  • 28. Agenda ➢ Scheduling Basics ➢ Goal of Real time Scheduling ➢ Classification of Scheduling algorithms ➢ Motivation for FPTS ➢ Preemptive Vs Non Preemptive Scheduling ➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS) ➢ Motivating example ➢ Schedulability Analysis ➢ Worst Case Response time ➢ Critical Instant ➢ Level - I active period ➢ Algorithm to find optimal thresholds ➢ Algorithm to find optimal priorities and thresholds ➢ Conclusion 28
  • 29. Algorithm : Optimal Minimum Threshold assignment Goal : Find minimum threshold assignment for a task set if one exists 29 Algorithm Taskset T = { Ci Ti Di Pi), ∀ i ∊ T Task set Feasible or not? Threshold θi ∀ i ∊ T
  • 31. Algorithm : Example Start from lowest priority task - T3 31 Task Ci Ti Di Pi θi WCRT T1 20 70 50 3 3 20 T2 20 80 80 2 2 40 T3 35 200 100 1 1 115
  • 32. Algorithm : Example Increase threshold of task T3 from 1 to 2. Meets deadline , assign threshold θ3 = 2 32 Task Ci Ti Di Pi θi WCRT T1 20 70 50 3 3 20 T2 20 80 80 2 2 95 T3 35 200 100 1 2 95
  • 33. Algorithm : Example Increase threshold of task T2 from 2 to 3. Meets deadline , assign threshold θ2 = 3 33 Task Ci Ti Di Pi θi WCRT T1 20 70 50 3 3 40 T2 20 80 80 2 3 75 T3 35 200 100 1 2 95
  • 34. Algorithm : Example Meets deadline , assign threshold θ1 = 3 34 Task Ci Ti Di Pi θi WCRT T1 20 70 50 3 3 40 T2 20 80 80 2 3 75 T3 35 200 100 1 2 95
  • 35. Agenda ➢ Scheduling Basics ➢ Goal of Real time Scheduling ➢ Classification of Scheduling algorithms ➢ Motivation for FPTS ➢ Preemptive Vs Non Preemptive Scheduling ➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS) ➢ Motivating example ➢ Schedulability Analysis ➢ Worst Case Response time ➢ Critical Instant ➢ Level - I active period ➢ Algorithm to find optimal thresholds ➢ Algorithm to find optimal priorities and thresholds ➢ Conclusion 35
  • 36. Algorithm : Optimal Priority and Threshold assignment Goal : Find optimal priority and minimum threshold assignment for a task set if one exists. 36 Algorithm Taskset T = { Ci Ti Di), ∀ i ∊ T Task set Feasible or not? Priority Pi ∀ i ∊ T Threshold θi ∀ i ∊ T
  • 37. Algorithm : Optimal Priority and Threshold assignment 37
  • 38. Algorithm : Optimal Priority and Threshold assignment 38
  • 39. Algorithm : Example TaskSet T = {T 1 , T2 , T3} Priority Ordered TaskSet = {} Priority P = { 1, 2 , 3 } 39 Task Ci Ti Di Pi θi WCRT T1 20 70 50 T2 20 80 80 T3 35 200 100
  • 40. Algorithm : Example TaskSet T = {T 1 , T2 , T3} Priority Ordered TaskSet = {} Priority P = { 1, 2 , 3 } 40 Task Ci Ti Di Pi θi WCRT Lateness WCRT (i)- Di T1 20 70 50 1 55 5 T2 20 80 80 T3 35 200 100
  • 41. Algorithm : Example TaskSet T = {T 1 , T2 , T3} Priority Ordered TaskSet = {} Priority P = { 1, 2 , 3 } 41 Task Ci Ti Di Pi θi WCRT Lateness WCRT (i)- Di T1 20 70 50 T2 20 80 80 1 95 15 T3 35 200 100
  • 42. Algorithm : Example TaskSet T = {T 1 , T2 , T3} Priority Ordered TaskSet = {} Priority P = { 1, 2 , 3 } Sorted List = {T 1 , T2 , T3} (Ascending Lateness - { 5, 15 , 15} ) Refine (Sorted List) = {T2,T3} // prune infeasible path ( T1 -> P1 = 1 , θ1 = 3) 42 Task Ci Ti Di Pi θi WCRT Lateness WCRT (i)- Di T1 20 70 50 T2 20 80 80 T3 35 200 100 1 115 15
  • 43. Algorithm : Example TaskSet T = {T 1 , T3} Priority Ordered TaskSet = { T2(1)} Priority P = { 2 , 3 } 43 Task Ci Ti Di Pi θi WCRT Lateness WCRT (i)- Di T1 20 70 50 2 55 5 T3 35 200 100
  • 44. Algorithm : Example TaskSet T = {T 1 , T3} Priority Ordered TaskSet = { T2(1)} Priority P = { 2 , 3 } 44 Task Ci Ti Di Pi θi WCRT Lateness WCRT (i)- Di T1 20 70 50 T3 35 200 100 2 55 -45
  • 45. Algorithm : Example TaskSet T = {T1} Priority Ordered TaskSet = { T3(2),T2(1)} Priority P = { 3 } 45 Task Ci Ti Di Pi θi WCRT Lateness WCRT (i)- Di T3 35 200 100
  • 46. Algorithm : Example TaskSet T = {T1} Priority Ordered TaskSet = { T1(2),T2(1)} Priority P = { 3 } 46 Task Ci Ti Di Pi θi WCRT Lateness WCRT (i)- Di T1 20 70 50 3 20 30
  • 47. Algorithm : Optimal Priority ordering TaskSet T = {} Priority Ordered TaskSet = { T1(3),T3(2),T2(1) } Priority P = {} 47 Task Ci Ti Di Pi θi WCRT T1 20 70 50 3 T2 20 80 80 1 T3 35 200 100 2
  • 48. Algorithm : Optimal Priority and Threshold assignment 48 1 {T1(3), T3(2), T2(1)} 2 {T1(1), T3(2), T2(3)} 3 {T1(1), T2(2) , T3(3)} 4 {T1(3), T2(2), T3(1)} 5 {T1(2), T2(3), T3(1)} 6 {T1(2), T2(1), T3(3)}
  • 49. Missing Information ➢ Next Priority ordering selection information missing. ➢ Algorithmic Complexity not mentioned. Exponential ➢ Task ordering when heuristics value matches? ➢ Experimental Results showing advantages of FPTS missing ➢ Minimal threshold assignment algorithm does not limit the preemptions 49
  • 50. Agenda ➢ Scheduling Basics ➢ Goal of Real time Scheduling ➢ Classification of Scheduling algorithms ➢ Motivation for FPTS ➢ Preemptive Vs Non Preemptive Scheduling ➢ Limited Preemptive Scheduling with Preemption Thresholds(FPTS) ➢ Motivating example ➢ Schedulability Analysis ➢ Worst Case Response time ➢ Critical Instant ➢ Level - I active period ➢ Algorithm to find optimal thresholds ➢ Algorithm to find optimal priorities and thresholds ➢ Conclusion 50
  • 51. Conclusion ➢ Limitation of Preemptions ➢ Why Limited Fixed priority scheduling techniques? ➢ How to perform Schedulability test by determining WCRT? ➢ Find minimum thresholds given priorities of the task set ➢ Find optimal priorities and feasible threshold assignment for task set 51
  • 52. References 1. Hard Real-Time Computing Systems by Giorgio C. Buttazzo 2. Y. Wang and M. Saksena. “Scheduling fixed-priority tasks with preemption threshold”. In Proc. 6th IEEE Real-Time Computing Systems and Applications (RTCSA), pages 328–335, Dec. 1999. 3. Reinder J. Bril and Johan J. Lukkien Wim F.J. Verhaegh “Worst-case response time analysis of real-time tasks under fixed-priority scheduling with deferred preemption revisited “ , TU/e, CS-Report 06-34, December 2006 4. K. W. Tindell , A. Burns , A. J. Wellings, An extendible approach for analyzing fixed priority hard real-time tasks, Real-Time Systems, v.6 n.2, p.133-151, March 1994 5. Buttazzo, G.C. ; Scuola Superiore Sant'anna, Pisa, Italy ; Bertogna, M. ; Gang Yao , Limited Preemptive Scheduling for Real-Time Systems. A Survey . In Industrial Informatics, I,05 March 2012 6. N. Audsley. Optimal priority assignment and feasibility of static priority tasks with arbitrary start times. Technical Report YCS 164, Department of Computer Science, University of York, England, Dec. 1999 52
  • 53. Thank You for your Attention Any Questions ? 53
  • 54. Questions 1. Why is the worst case response time calculated as the maximum response time of the jobs in the Level-i active period? 2. How do you determine / measure the least upper bound utilisation schedulability criteria for FPTS? 3. What is the additional costs incurred by optimal priority and preemption threshold assignment algorithm? How does it compare to the preemption costs incurred by FPPS? 4. Is the optimal priority and preemption threshold assignment done in static or dynamic manner? 5. How efficient it is for resource constrained set up ? 6. What is the difference between level-i active and level-i busy period? 7. FPTS increases schedulability of task set by combining FPPS & FPNS, but the worst case response time of some of the tasks are increased (compared to FPDS) although they meet the deadlines.Does it have any impact on the system? 8. What is the run-time complexity of the proposed algorithms based on task set (n)? 54
  • 55. What to follow ? Scalable real time system design using Preemption Thresholds by Shashidhar B.L 55