SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Periodic Task Scheduling
Radek Pel´nek
a
Introduction

Periodic Scheduling

Motivation and Assumptions

Examples of Periodic Tasks

sensory data acquisition
control loops
action planning
system monitoring

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Motivation and Assumptions

Simplifying Assumptions

constant period Ti
all instances (jobs) of a task have the same computation
time Ci
no precedence relations, no resources
preemption
(deadline is equal to period Di = Ti )
(no aperiodic jobs)
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Motivation and Assumptions

Example

Ci
Ti

τ1 τ2 τ3
2 4 3
6 10 12

find schedule
think about possible scheduling algorithms
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Motivation and Assumptions

Outlook

notions: jitter, processor utilization, schedulable
utilization
three basic approaches: static scheduling, dynamic
priorities (EDF), fixed priorities (rate monotonic)
examples
discussion
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Motivation and Assumptions

Jitter

deviation of the start/finishing time of consecutive
instances of some task
relative, absolute jitter
for some applications it is important to minimize the jitter
we do not deal with this issue in detail
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Processor Utilization Factor

Processor Utilization Factor
Definition (Processor utilization factor)
Given a set Γ of n periodic tasks, processor utilization factor U
is the fraction of processor time spent in the execution of the
task set:
U = Σn
i=1
4
3
2
Example: U = 6 + 10 + 12 = 59
60
Note: U > 1 ⇒ not schedulable

Ci
Ti
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Processor Utilization Factor

Schedulable Utilization

Definition (Schedulable Utilization)
schedulable utilization US of a scheduling algorithm – the
algorithm can feasibly schedule any set of periodic tasks o
with the total utilization of the tasks is ≤ US
used to easily verify the schedulability of a task set
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Cyclic Scheduling

Cyclic Scheduling

an approach, rather than algorithm
(timeline scheduling, clock-driven scheduling)
static schedule, constructed off-line
schedule specifies exactly when each job executes
minor cycle = greatest common divisor of periods
major cycle = time after which the schedule repeats itself
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Cyclic Scheduling

Example

TA = 25, TB = 50, TC = 100
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Cyclic Scheduling

Aperiodic Jobs

spare capacities in the static schedule can be used for
handling aperiodic jobs
aperiodic jobs can be scheduled e.g. by deadline based
algorithm
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Cyclic Scheduling

Advantages and Disadvantages
advantages:
simple, efficient (precomputed)
can deal with complex requirements, precedence
constraints, ...
special requirements can be taken into account (e.g.,
minimizing jitter or context switches)

disadvantages:
inflexible, difficult to modify and maintain
fragile (overrun may cause whole schedule to fail)
not very suitable for systems with both periodic and
aperiodic tasks

Suitable for systems which are rarely modified once built (e.g.,
small embedded controllers).
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Earliest Deadline First

Earliest Deadline First

dynamic priority assignment
selects tasks according to absolute deadline
does not depend on periodicity; can be directly used for
periodic+aperiodic tasks
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Earliest Deadline First

Schedulability Analysis

Schedulable utilization of EDF is 1.
Theorem
A set of periodic tasks is schedulable with EDF if and only if

Σn
i=1

Ci
≤1
Ti
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Earliest Deadline First

Extensions

deadlines less than periods, aperiodic jobs
the algorithm works directly for both extensions
schedulability analysis is more complex (not covered)
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Rate Monotonic

Rate Monotonic Scheduling

priority based algorithm: tasks scheduled according to
priorities
fixed-priority assignment: priorities assigned before the
execution (all jobs of one task have the same priority)
priorities according to periods: shorter period - higher
priority
preemptive
Introduction

Periodic Scheduling

Rate Monotonic

Example

Ci
Ti

τ1 τ2 τ3
2 4 3
6 10 12

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Rate Monotonic

Optimality

in general RM is not optimal
RM is optimal among fixed-priority algorithms
Theorem
If a task set can be scheduled by fixed-priority algorithm then
it can be scheduled by Rate Monotonic algorithm.
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Rate Monotonic

Schedulable Utilization
For arbitrary set of periodic tasks, the schedulable utilization
of the RM scheduling algorithm is
US = n(21/n − 1)
n
1
2
3
4
5
US 1.00 0.82 0.78 0.76 0.74
For high values of n the schedulable utilization converges to
Ulub = ln 2 ∼ 0.69
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Rate Monotonic

Optimality for Simply Periodic Tasks

a set of periodic tasks is simply periodic if for every pair
of tasks: Ti < Tj ⇒ Tj is an integer multiple of Ti
Theorem
A system of simply periodic tasks is schedulable according to
the RM algorithm if and only if its utilization factor is ≤ 1.
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Rate Monotonic

Deadline Monotonic

deadlines less than period
priorities assigned according to inverse of relative
deadlines
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Examples and Comparison

Example

Ci
Ti

τ1 τ2
2 4
5 7

What is the utilization factor?
Is the task set schedulable?
What is the schedule produced by EDF/RM?
Introduction

Periodic Scheduling

Examples and Comparison

Example

U=

2 4
34
+ =
∼ 0.97
5 7
35

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Examples and Comparison

Example 2

Ci
Ti

τ1 τ2 τ3
2 2 2
6 8 12

What is the utilization factor? Is the task set schedulable?
What is the schedule produced by RM?
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Examples and Comparison

Example 3

Ci
Ti

τ1 τ2 τ3
1 2 3
4 6 8

What is the utilization factor? Is the task set schedulable?
What is the schedule produced by RM/EDF?
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Examples and Comparison

Comparison: RM vs EDF
RM
implementation
multi-level
priority queue, O(1)
processor utilization guarantee only for 0.69,
practice 0.88
context switches
many
guarantee test
nontrivial
predictability
good
in practice: fixed-priority schedulers

EDF
heap, O(log n)
full utilization
few
simple
bad
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Examples and Comparison

Note on Predictability

overload condition (processor utilization factor > 1),
which tasks will not meet deadlines?
EDF – unpredictable
RM – predictable (tasks with the longest period)

reminder: Apollo 11 landing
processor overload
RM algorithm used ⇒ predictable behaviour ⇒ decision
possible
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Aperiodic Jobs in Priority-driven Systems

real systems – combination of periodic and aperiodic tasks
main approaches:
fixed priority servers: scheduling of periodic tasks done
by fixed priority algorithm (typically RM)
dynamic priority servers: scheduling of periodic tasks
done by dynamic priority algorithm (typically EDF)
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Assumptions and Remarks
periodic tasks scheduled by a fixed priority algorithm
(specifically rate monotonic)
all periodic tasks start simultaneously at time t = 0,
deadline = period
arrival times of aperiodic tasks are unknown beforehand
preemption
goal: meet deadlines of periodic tasks, minimize response
time of aperiodic tasks
ordering of aperiodic tasks not discussed (done by some
aperiodic scheduling algorithm, we will use FIFO)
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Example
Periodic jobs:

Ci
Ti

τ1 τ2
1 2
4 6

Aperiodic jobs:

ai
Ci

J1 J2 J3 J4
2 8 12 19
2 1 2 1
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Background Scheduling

Background Scheduling

aperiodic tasks scheduled in background (when no
periodic task is running)
schedule of periodic tasks is not changed
major problem: high periodic load ⇒ poor response times
for aperiodic tasks
Introduction
Background Scheduling

Example

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems
Introduction
Background Scheduling

Realization

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Polling Server

Server for Aperiodic Tasks

periodic task whose purpose is to service aperiodic
requests
period TS , computation time CS (capacity)
scheduled in the same way as periodic tasks
note: selection of TS , CS – total utilization factor must
remain ≤ 1
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Polling Server

Polling Server

the simplest variant of server
when active: serve pending aperiodic requests within its
capacity
no aperiodic requests are pending ⇒ suspend
Introduction

Periodic Scheduling

Polling Server

Polling Server: Example

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Polling Server

Improving Polling Server

how can we improve the performance?
(consider the previous example)

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Deferrable Server

Deferrable Server

similar to polling server
if no aperiodic requests are pending:
suspend itself
preserve capacity until the end of the period
if aperiodic request arrives later during the period: it is
served

at the beginning of the period capacity is fully replenished
Introduction

Periodic Scheduling

Deferrable Server

Deferrable Server: Example

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Deferrable Server

Deferrable Server: Properties

deferrable server provides better responsiveness than
polling server
schedulability analysis more complicated
defferable server is not equivalent to periodic task
Introduction

Periodic Scheduling

Deferrable Server

Deferrable Server: Example 2

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Priority Exchange

Priority Exchange

periodic server with high priority
preserves capacity by exchanging it for the execution time
of a lower-priority task:
at the beginning of the period: replenish the capacity
aperiodic requests are pending: serve them
no aperiodic requests are pending: exchange execution
time with the active periodic task with the highest
priority

the priority exchange is performed repeatedly
Introduction
Priority Exchange

Example

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Slack Stealing

Slack Stealing

no periodic server; passive task Slack Stealer
slack = di − t − ci (t)
main idea:
no benefit in early completion of periodic tasks
when aperiodic request arrives: steal available slacks

better responsiveness, more complicated schedulability
analysis
Introduction
Slack Stealing

Example

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Discussion

Non-existence of Optimal Servers

Theorem
For any set of periodic tasks ordered on a given fixed-priority
scheme and aperiodic requests ordered according to a given
aperiodic queueing discipline, there does not exist any valid
algorithm that minimizes the response time of every soft
aperiodic request.
Similarly for average response time.
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Discussion

Evaluation of Fixed Priority Servers
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Discussion

Example

periodic tasks
τ1 τ2
Ci 1 2
Ti 5 8

aperiodic tasks
J1 J2 J3
ai 2 7 17
Ci 3 1 1

Create schedules and determine response times:
background scheduling
polling server with intermediate priority
deferrable server with the highest priority
Introduction

Periodic Scheduling

Aperiodic Jobs in Priority-driven Systems

Discussion

Summary of the Lecture

scheduling periodic tasks
cyclic scheduling (static schedule)
rate monotonic scheduling (static priorities)
earliest deadline first scheduling (dynamic priorities)

processor utilization factor, schedulable utilization
aperiodic tasks in periodic systems: fixed priority servers

Weitere ähnliche Inhalte

Was ist angesagt?

Reference Model of Real Time System
Reference Model of Real Time SystemReference Model of Real Time System
Reference Model of Real Time SystemRaaz Karkee
 
Real Time most famous algorithms
Real Time most famous algorithmsReal Time most famous algorithms
Real Time most famous algorithmsAndrea Tino
 
Real time scheduling - basic concepts
Real time scheduling - basic conceptsReal time scheduling - basic concepts
Real time scheduling - basic conceptsStudent
 
Schedulability of Rate Monotonic Algorithm using Improved Time Demand Analysi...
Schedulability of Rate Monotonic Algorithm using Improved Time Demand Analysi...Schedulability of Rate Monotonic Algorithm using Improved Time Demand Analysi...
Schedulability of Rate Monotonic Algorithm using Improved Time Demand Analysi...IJECEIAES
 
Full solution manual real time system by jane w s liu solution manual
Full solution manual real time system by jane w s liu solution manualFull solution manual real time system by jane w s liu solution manual
Full solution manual real time system by jane w s liu solution manualneeraj7svp
 
Real time-system
Real time-systemReal time-system
Real time-systemysush
 
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...ijcsit
 
Solution manual real time system bt jane w s liu solution manual
Solution manual real time system bt jane w s liu solution manual   Solution manual real time system bt jane w s liu solution manual
Solution manual real time system bt jane w s liu solution manual neeraj7svp
 
SCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICE
SCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICESCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICE
SCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICEijait
 
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesFellowBuddy.com
 
Performance evaluation of two degree of freedom conventional controller adopt...
Performance evaluation of two degree of freedom conventional controller adopt...Performance evaluation of two degree of freedom conventional controller adopt...
Performance evaluation of two degree of freedom conventional controller adopt...IJECEIAES
 
Ch2 mathematical modeling of control system
Ch2 mathematical modeling of control system Ch2 mathematical modeling of control system
Ch2 mathematical modeling of control system Elaf A.Saeed
 

Was ist angesagt? (20)

Reference Model of Real Time System
Reference Model of Real Time SystemReference Model of Real Time System
Reference Model of Real Time System
 
Real Time most famous algorithms
Real Time most famous algorithmsReal Time most famous algorithms
Real Time most famous algorithms
 
Real Time System
Real Time SystemReal Time System
Real Time System
 
Real Time System
Real Time SystemReal Time System
Real Time System
 
Real time scheduling - basic concepts
Real time scheduling - basic conceptsReal time scheduling - basic concepts
Real time scheduling - basic concepts
 
slot_shifting
slot_shiftingslot_shifting
slot_shifting
 
RTS
RTSRTS
RTS
 
Os5
Os5Os5
Os5
 
Schedulability of Rate Monotonic Algorithm using Improved Time Demand Analysi...
Schedulability of Rate Monotonic Algorithm using Improved Time Demand Analysi...Schedulability of Rate Monotonic Algorithm using Improved Time Demand Analysi...
Schedulability of Rate Monotonic Algorithm using Improved Time Demand Analysi...
 
Full solution manual real time system by jane w s liu solution manual
Full solution manual real time system by jane w s liu solution manualFull solution manual real time system by jane w s liu solution manual
Full solution manual real time system by jane w s liu solution manual
 
Real time-system
Real time-systemReal time-system
Real time-system
 
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
STATISTICAL APPROACH TO DETERMINE MOST EFFICIENT VALUE FOR TIME QUANTUM IN RO...
 
Solution manual real time system bt jane w s liu solution manual
Solution manual real time system bt jane w s liu solution manual   Solution manual real time system bt jane w s liu solution manual
Solution manual real time system bt jane w s liu solution manual
 
L09
L09L09
L09
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
 
SCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICE
SCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICESCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICE
SCHEDULING DIFFERENT CUSTOMER ACTIVITIES WITH SENSING DEVICE
 
Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture Notes
 
Event Scheduling
Event SchedulingEvent Scheduling
Event Scheduling
 
Performance evaluation of two degree of freedom conventional controller adopt...
Performance evaluation of two degree of freedom conventional controller adopt...Performance evaluation of two degree of freedom conventional controller adopt...
Performance evaluation of two degree of freedom conventional controller adopt...
 
Ch2 mathematical modeling of control system
Ch2 mathematical modeling of control system Ch2 mathematical modeling of control system
Ch2 mathematical modeling of control system
 

Andere mochten auch

Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 

Andere mochten auch (6)

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
Process and CPU scheduler
Process and CPU schedulerProcess and CPU scheduler
Process and CPU scheduler
 
Scheduling
SchedulingScheduling
Scheduling
 
Mastering Real-time Linux
Mastering Real-time LinuxMastering Real-time Linux
Mastering Real-time Linux
 
Round robin
Round robinRound robin
Round robin
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 

Ähnlich wie Periodic

Ähnlich wie Periodic (20)

Chap 4.ppt
Chap 4.pptChap 4.ppt
Chap 4.ppt
 
Chap 4.ppt
Chap 4.pptChap 4.ppt
Chap 4.ppt
 
task_sched2.ppt
task_sched2.ppttask_sched2.ppt
task_sched2.ppt
 
Real time-embedded-system-lec-02
Real time-embedded-system-lec-02Real time-embedded-system-lec-02
Real time-embedded-system-lec-02
 
ESC UNIT 3.ppt
ESC UNIT 3.pptESC UNIT 3.ppt
ESC UNIT 3.ppt
 
Embedded system scheduling Algorithm .pptx
Embedded system scheduling Algorithm .pptxEmbedded system scheduling Algorithm .pptx
Embedded system scheduling Algorithm .pptx
 
RTOS
RTOSRTOS
RTOS
 
Real time system tsp
Real time system tspReal time system tsp
Real time system tsp
 
Scheduling and Scheduler's Process and Premptive
Scheduling and Scheduler's Process and PremptiveScheduling and Scheduler's Process and Premptive
Scheduling and Scheduler's Process and Premptive
 
Process management
Process managementProcess management
Process management
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
Priority Scheduling
Priority Scheduling  Priority Scheduling
Priority Scheduling
 
Ch6
Ch6Ch6
Ch6
 
Real-Time Systems v3.pptx
Real-Time Systems v3.pptxReal-Time Systems v3.pptx
Real-Time Systems v3.pptx
 
ERTS UNIT 5.pptx
ERTS UNIT 5.pptxERTS UNIT 5.pptx
ERTS UNIT 5.pptx
 
Scheduling algorithm in real time system
Scheduling algorithm in real time systemScheduling algorithm in real time system
Scheduling algorithm in real time system
 
Rate.docx
Rate.docxRate.docx
Rate.docx
 
Operating System 5
Operating System 5Operating System 5
Operating System 5
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Survey of Real Time Scheduling Algorithms
Survey of Real Time Scheduling AlgorithmsSurvey of Real Time Scheduling Algorithms
Survey of Real Time Scheduling Algorithms
 

Kürzlich hochgeladen

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Periodic

  • 1. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Periodic Task Scheduling Radek Pel´nek a
  • 2. Introduction Periodic Scheduling Motivation and Assumptions Examples of Periodic Tasks sensory data acquisition control loops action planning system monitoring Aperiodic Jobs in Priority-driven Systems
  • 3. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Simplifying Assumptions constant period Ti all instances (jobs) of a task have the same computation time Ci no precedence relations, no resources preemption (deadline is equal to period Di = Ti ) (no aperiodic jobs)
  • 4. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Example Ci Ti τ1 τ2 τ3 2 4 3 6 10 12 find schedule think about possible scheduling algorithms
  • 5. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Outlook notions: jitter, processor utilization, schedulable utilization three basic approaches: static scheduling, dynamic priorities (EDF), fixed priorities (rate monotonic) examples discussion
  • 6. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Motivation and Assumptions Jitter deviation of the start/finishing time of consecutive instances of some task relative, absolute jitter for some applications it is important to minimize the jitter we do not deal with this issue in detail
  • 7. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Processor Utilization Factor Processor Utilization Factor Definition (Processor utilization factor) Given a set Γ of n periodic tasks, processor utilization factor U is the fraction of processor time spent in the execution of the task set: U = Σn i=1 4 3 2 Example: U = 6 + 10 + 12 = 59 60 Note: U > 1 ⇒ not schedulable Ci Ti
  • 8. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Processor Utilization Factor Schedulable Utilization Definition (Schedulable Utilization) schedulable utilization US of a scheduling algorithm – the algorithm can feasibly schedule any set of periodic tasks o with the total utilization of the tasks is ≤ US used to easily verify the schedulability of a task set
  • 9. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Cyclic Scheduling Cyclic Scheduling an approach, rather than algorithm (timeline scheduling, clock-driven scheduling) static schedule, constructed off-line schedule specifies exactly when each job executes minor cycle = greatest common divisor of periods major cycle = time after which the schedule repeats itself
  • 10. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Cyclic Scheduling Example TA = 25, TB = 50, TC = 100
  • 11. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Cyclic Scheduling Aperiodic Jobs spare capacities in the static schedule can be used for handling aperiodic jobs aperiodic jobs can be scheduled e.g. by deadline based algorithm
  • 12. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Cyclic Scheduling Advantages and Disadvantages advantages: simple, efficient (precomputed) can deal with complex requirements, precedence constraints, ... special requirements can be taken into account (e.g., minimizing jitter or context switches) disadvantages: inflexible, difficult to modify and maintain fragile (overrun may cause whole schedule to fail) not very suitable for systems with both periodic and aperiodic tasks Suitable for systems which are rarely modified once built (e.g., small embedded controllers).
  • 13. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Earliest Deadline First Earliest Deadline First dynamic priority assignment selects tasks according to absolute deadline does not depend on periodicity; can be directly used for periodic+aperiodic tasks
  • 14. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Earliest Deadline First Schedulability Analysis Schedulable utilization of EDF is 1. Theorem A set of periodic tasks is schedulable with EDF if and only if Σn i=1 Ci ≤1 Ti
  • 15. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Earliest Deadline First Extensions deadlines less than periods, aperiodic jobs the algorithm works directly for both extensions schedulability analysis is more complex (not covered)
  • 16. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Rate Monotonic Scheduling priority based algorithm: tasks scheduled according to priorities fixed-priority assignment: priorities assigned before the execution (all jobs of one task have the same priority) priorities according to periods: shorter period - higher priority preemptive
  • 17. Introduction Periodic Scheduling Rate Monotonic Example Ci Ti τ1 τ2 τ3 2 4 3 6 10 12 Aperiodic Jobs in Priority-driven Systems
  • 18. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Optimality in general RM is not optimal RM is optimal among fixed-priority algorithms Theorem If a task set can be scheduled by fixed-priority algorithm then it can be scheduled by Rate Monotonic algorithm.
  • 19. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Schedulable Utilization For arbitrary set of periodic tasks, the schedulable utilization of the RM scheduling algorithm is US = n(21/n − 1) n 1 2 3 4 5 US 1.00 0.82 0.78 0.76 0.74 For high values of n the schedulable utilization converges to Ulub = ln 2 ∼ 0.69
  • 20. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Optimality for Simply Periodic Tasks a set of periodic tasks is simply periodic if for every pair of tasks: Ti < Tj ⇒ Tj is an integer multiple of Ti Theorem A system of simply periodic tasks is schedulable according to the RM algorithm if and only if its utilization factor is ≤ 1.
  • 21. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Rate Monotonic Deadline Monotonic deadlines less than period priorities assigned according to inverse of relative deadlines
  • 22. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Example Ci Ti τ1 τ2 2 4 5 7 What is the utilization factor? Is the task set schedulable? What is the schedule produced by EDF/RM?
  • 23. Introduction Periodic Scheduling Examples and Comparison Example U= 2 4 34 + = ∼ 0.97 5 7 35 Aperiodic Jobs in Priority-driven Systems
  • 24. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Example 2 Ci Ti τ1 τ2 τ3 2 2 2 6 8 12 What is the utilization factor? Is the task set schedulable? What is the schedule produced by RM?
  • 25. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Example 3 Ci Ti τ1 τ2 τ3 1 2 3 4 6 8 What is the utilization factor? Is the task set schedulable? What is the schedule produced by RM/EDF?
  • 26. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Comparison: RM vs EDF RM implementation multi-level priority queue, O(1) processor utilization guarantee only for 0.69, practice 0.88 context switches many guarantee test nontrivial predictability good in practice: fixed-priority schedulers EDF heap, O(log n) full utilization few simple bad
  • 27. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Examples and Comparison Note on Predictability overload condition (processor utilization factor > 1), which tasks will not meet deadlines? EDF – unpredictable RM – predictable (tasks with the longest period) reminder: Apollo 11 landing processor overload RM algorithm used ⇒ predictable behaviour ⇒ decision possible
  • 28. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Aperiodic Jobs in Priority-driven Systems real systems – combination of periodic and aperiodic tasks main approaches: fixed priority servers: scheduling of periodic tasks done by fixed priority algorithm (typically RM) dynamic priority servers: scheduling of periodic tasks done by dynamic priority algorithm (typically EDF)
  • 29. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Assumptions and Remarks periodic tasks scheduled by a fixed priority algorithm (specifically rate monotonic) all periodic tasks start simultaneously at time t = 0, deadline = period arrival times of aperiodic tasks are unknown beforehand preemption goal: meet deadlines of periodic tasks, minimize response time of aperiodic tasks ordering of aperiodic tasks not discussed (done by some aperiodic scheduling algorithm, we will use FIFO)
  • 30. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Example Periodic jobs: Ci Ti τ1 τ2 1 2 4 6 Aperiodic jobs: ai Ci J1 J2 J3 J4 2 8 12 19 2 1 2 1
  • 31. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Background Scheduling Background Scheduling aperiodic tasks scheduled in background (when no periodic task is running) schedule of periodic tasks is not changed major problem: high periodic load ⇒ poor response times for aperiodic tasks
  • 34. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Polling Server Server for Aperiodic Tasks periodic task whose purpose is to service aperiodic requests period TS , computation time CS (capacity) scheduled in the same way as periodic tasks note: selection of TS , CS – total utilization factor must remain ≤ 1
  • 35. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Polling Server Polling Server the simplest variant of server when active: serve pending aperiodic requests within its capacity no aperiodic requests are pending ⇒ suspend
  • 36. Introduction Periodic Scheduling Polling Server Polling Server: Example Aperiodic Jobs in Priority-driven Systems
  • 37. Introduction Periodic Scheduling Polling Server Improving Polling Server how can we improve the performance? (consider the previous example) Aperiodic Jobs in Priority-driven Systems
  • 38. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Deferrable Server Deferrable Server similar to polling server if no aperiodic requests are pending: suspend itself preserve capacity until the end of the period if aperiodic request arrives later during the period: it is served at the beginning of the period capacity is fully replenished
  • 39. Introduction Periodic Scheduling Deferrable Server Deferrable Server: Example Aperiodic Jobs in Priority-driven Systems
  • 40. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Deferrable Server Deferrable Server: Properties deferrable server provides better responsiveness than polling server schedulability analysis more complicated defferable server is not equivalent to periodic task
  • 41. Introduction Periodic Scheduling Deferrable Server Deferrable Server: Example 2 Aperiodic Jobs in Priority-driven Systems
  • 42. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Priority Exchange Priority Exchange periodic server with high priority preserves capacity by exchanging it for the execution time of a lower-priority task: at the beginning of the period: replenish the capacity aperiodic requests are pending: serve them no aperiodic requests are pending: exchange execution time with the active periodic task with the highest priority the priority exchange is performed repeatedly
  • 44. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Slack Stealing Slack Stealing no periodic server; passive task Slack Stealer slack = di − t − ci (t) main idea: no benefit in early completion of periodic tasks when aperiodic request arrives: steal available slacks better responsiveness, more complicated schedulability analysis
  • 46. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Discussion Non-existence of Optimal Servers Theorem For any set of periodic tasks ordered on a given fixed-priority scheme and aperiodic requests ordered according to a given aperiodic queueing discipline, there does not exist any valid algorithm that minimizes the response time of every soft aperiodic request. Similarly for average response time.
  • 47. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Discussion Evaluation of Fixed Priority Servers
  • 48. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Discussion Example periodic tasks τ1 τ2 Ci 1 2 Ti 5 8 aperiodic tasks J1 J2 J3 ai 2 7 17 Ci 3 1 1 Create schedules and determine response times: background scheduling polling server with intermediate priority deferrable server with the highest priority
  • 49. Introduction Periodic Scheduling Aperiodic Jobs in Priority-driven Systems Discussion Summary of the Lecture scheduling periodic tasks cyclic scheduling (static schedule) rate monotonic scheduling (static priorities) earliest deadline first scheduling (dynamic priorities) processor utilization factor, schedulable utilization aperiodic tasks in periodic systems: fixed priority servers