Blocking Analysis of FIFO, Unordered, and Priority-Ordered ...bbb/papers/talks/rtss13a.pdfOn Spin...
Transcript of Blocking Analysis of FIFO, Unordered, and Priority-Ordered ...bbb/papers/talks/rtss13a.pdfOn Spin...
On Spin Locks in AUTOSAR: Blocking Analysis of FIFO, Unordered,
and Priority-Ordered Spin Locks
Alexander Wieder and Björn BrandenburgMPI-SWS
RTSS 201312/04/2013
Vancouver, Canada
OS-specification widely used for embedded applications
AUTOSAR:
Resources accessed from multiple cores:
AUTOSAR mandates spin locks.
Motivation:
But AUTOSAR does not specify spin lock type!
OS-specification widely used for embedded applications
AUTOSAR:
Motivation:
Resources accessed from multiple cores:
AUTOSAR mandates spin locks.
But AUTOSAR does not specify spin lock type!
OS-specification widely used for embedded applications
AUTOSAR:
Motivation:
Resources accessed from multiple cores:
AUTOSAR mandates spin locks.
Which type should be used?
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
Spin Lock TypesVariety of reasonable choices:
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Variety of reasonable choices:
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
Spin Lock Types
FIFO-ordered(MSRP)
simple implementation(test&set)
low architecture requirements
safe for unknown lock types
support forlocking priorities
analysis-friendly
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
Spin Lock TypesVariety of reasonable choices:
PreemptableSpinning
Non-PreemptableSpinning
FIFO-ordered(MSRP)
No blocking analysis available
for most types!
ContributionsBlocking analysis
for 8 types of spin locks
ContributionsBlocking analysis
for 8 types of spin locks
7/8 spin lock types:first blocking analysis
ContributionsBlocking analysis
for 8 types of spin locks
7/8 spin lock types:first blocking analysis
Asymptoticallyless pessimistic
than prior approaches
ContributionsBlocking analysis
for 8 types of spin locks
Suggest AUTOSAR API changes based on evaluation results
7/8 spin lock types:first blocking analysis
Asymptoticallyless pessimistic
than prior approaches
Novel Spin Lock AnalysisKey Technique:
Blocking Analysismodeled as
Integer Linear Program (ILP)
Novel Spin Lock AnalysisKey Technique:
Blocking Analysismodeled as
Integer Linear Program (ILP)
Worst-case blocking bounds determined by ILP solver
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
• sporadic tasks:
• constrained deadlines:
•partitioned fixed-priority scheduling
Task Model
Ti : (ei, di, pi)
di pi
Basic Spin Lock Analysis
Spin locks busy-wait while waiting for contended resource.
Basic Spin Lock Analysis
Straight-forward analysis approach:• treat spin-time as execution time• apply response-time analysis
Spin locks busy-wait while waiting for contended resource.
FIFO-Ordered Spin Locks
[1] P. Gai, G. Lipari, and M. Di Natale, “Minimizing memory utilization of real-time task sets in single and multi-processor systems-on-a-chip,” in RTSS’01. IEEE, 2001.
Multiprocessor Stack Resource Policy (MSRP) [1]
FIFO-Ordered Spin Locks
[1] P. Gai, G. Lipari, and M. Di Natale, “Minimizing memory utilization of real-time task sets in single and multi-processor systems-on-a-chip,” in RTSS’01. IEEE, 2001.
Multiprocessor Stack Resource Policy (MSRP) [1]
The MSRP uses non-preemptable
FIFO-ordered spin locksfor resources shared across processors.
FIFO-Ordered Spin Locksclassic MSRP analysis
response-timeanalysis
inflate execution time
⌧
⌧ 0
FIFO-Ordered Spin Locksclassic MSRP analysis
response-timeanalysis
inflate execution time
⌧
⌧ 0
inflatedexecution times
FIFO-Ordered Spin Locksclassic MSRP analysis
response-timeanalysis
inflate execution time
⌧
⌧ 0
inflatedexecution times
Ri = e0i +X
h<i
⇠Ri
ph
⇡· e0h
FIFO-Ordered Spin Locksclassic MSRP analysis
response-timeanalysis
inflate execution time
⌧
⌧ 0
inflatedexecution times
Ri = e0i +X
h<i
⇠Ri
ph
⇡· e0h
T1
T2
T3
P1
P2t
Executing Critical SectionSpinning
Pending but not scheduled
Execution-Time Inflation in Classic MSRP Analysis
Execution-Time Inflation in Classic MSRP Analysis
T1
T2
T3
P1
P2t
Executing Critical SectionSpinning
Pending but not scheduled
T1 busy-waiting for shared resource
T1
T2
T3
P1
P2t
Executing Critical SectionSpinning
Pending but not scheduled
T2’s job pending, but not executing
Execution-Time Inflation in Classic MSRP Analysis
T1
T2
T3
P1
P2t
Executing Critical SectionSpinning
Pending but not scheduled
T2’s job completes
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
Consider T1‘s request
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
Consider T1‘s request
T1’s requestcould be blocked by
T3’s request
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
T1’s job busy-waits
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
Execution time inflation:Spin time treated as
execution time
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
Execution time inflation:Spin time treated as
execution time
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
original execution time
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
inflated execution time
original execution time
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
Execution time inflated forall jobs!
Execution-Time Inflation in Classic MSRP Analysis
Pending but not scheduled
Executing Critical SectionSpinning
T1
T3
P1
P2t
Execution time inflated forall jobs!
Execution-Time Inflation in Classic MSRP Analysis
Original Schedule
T1
T2
T3
P1
P2t
Executing Critical SectionSpinning
Pending but not scheduled
T2’s job completes
Pending but not scheduled
Executing Critical SectionSpinning
Schedule with Inflated Execution Times
T1
T3
P1
P2tDeadline
Miss
T2
Pending but not scheduled
Executing Critical SectionSpinning
Schedule with Inflated Execution Times
T1
T3
P1
P2tDeadline
MissImpossible in a real schedule!
T2
T1
T2
T3
P1
P2t
Executing Critical SectionSpinning
Pending but not scheduled
At most one can be blocked!
Original Schedule
All prior analyses rely on execution time inflation!
Inflation is Inherently Pessimistic
All prior analyses rely on execution time inflation!
We show thatexecution time inflation
is an inherent source of pessimism
in blocking analysis.
Inflation is Inherently Pessimistic
Inflation is Inherently Pessimistic
TheoremAny blocking analysis relying on the
inflation of job execution costs can be pessimistic by a factor of .⌦(� · n)
Inflation is Inherently Pessimistic
TheoremAny blocking analysis relying on the
inflation of job execution costs can be pessimistic by a factor of .⌦(� · n)
maximal ratio of shortest and longest
task period
number of tasks
Inflation is Inherently Pessimistic
TheoremAny blocking analysis relying on the
inflation of job execution costs can be pessimistic by a factor of .⌦(� · n)
Details and proof in paper
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
ILP formulationExplicit blocking terms
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
ILP formulationExplicit blocking terms
ILP-Based Blocking Analysis of Spin Locks
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
⌧
⌧
ILP-Based Blocking Analysis of Spin Locks
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
⌧
⌧
Blocking Analysismodeled as
Integer Linear Program (ILP)
Key technique for inflation-free blocking analysis:
Worst-case blocking bounds determined by ILP solver
T1
T2
T3
P1
P2
t
P3
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
T1
T2
T3
P1
P2
t
P3
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
T1
T2
T3
P1
P2
t
P3
Assign blocking variables:
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
T1
T2
T3
P1
P2
t
P3
Assign blocking variables:
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Blocking Variables
0 X 1
X : Fraction of critical section length contributing to T1’s blocking
Blocking Variables
Request does not contribute
to T1’s blocking.
Request contributes
to T1’s blocking.
0 X 1
X = 0
X = 1
X : Fraction of critical section length contributing to T1’s blocking
Blocking Variables
Request does not contribute
to T1’s blocking.
Request contributes
to T1’s blocking.
0 X 1
X = 0
X = 1
X : Fraction of critical section length contributing to T1’s blocking
Analysis accountsat most once
for each request
Blocking Variables
Request does not contribute
to T1’s blocking.
Request contributes
to T1’s blocking.
0 X 1
X = 0
X = 1
X : Fraction of critical section length contributing to T1’s blocking
Analysis accountsat most once
for each request
No double counting!
T1
T2
T3
P1
P2
t
P3
Impose constraints:
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
T1
T2
T3
P1
P2
t
P3
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
ObservationEach request can be blocked by
at most one request for the same resource from each other processor.
Impose constraints:
T1
T2
T3
P1
P2
t
P3
Impose constraints:
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
T1
T2
T3
P1
P2
t
P3
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Impose constraints:
T1
T2
T3
P1
P2
t
P3
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Impose constraints:
constraints to rule out
impossible schedules
T1
T2
T3
P1
P2
t
P3
ILP Generation for FIFO-Ordered Spin Locks
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Impose constraints:
constraints to rule out
impossible schedules
ILP Constraints
• simple• composable
X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Generate Integer Linear Program:
ILP for Worst-Case Blocking
X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Generate Integer Linear Program:
worst-case blocking≃
maximal blocking
ILP for Worst-Case Blocking
X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Generate Integer Linear Program:
X2,1,1 · L2,1,1 +X2,1,2 · L2,1,2 +X2,1,3 · L2,1,3
+X3,1,1 · L3,1,1 +X3,1,2 · L3,1,2
maximize
subject to
ILP for Worst-Case Blocking
X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Generate Integer Linear Program:maximize
subject to
ILP for Worst-Case Blocking
X2,1,1 · L2,1,1 +X2,1,2 · L2,1,2 +X2,1,3 · L2,1,3
+X3,1,1 · L3,1,1 +X3,1,2 · L3,1,2
maximal critical section length
X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Generate Integer Linear Program:
X2,1,1 · L2,1,1 +X2,1,2 · L2,1,2 +X2,1,3 · L2,1,3
+X3,1,1 · L3,1,1 +X3,1,2 · L3,1,2
maximize
subject to
ILP for Worst-Case Blocking
Worst-case blocking bound determined by ILP solver.
Explicit Accounting for Blocking
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
⌧
⌧
Ri = ei + bi +X
h<i
⇠Ri
ph
⇡· eh
Explicit Accounting for Blocking
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
⌧
⌧
Ri = ei + bi +X
h<i
⇠Ri
ph
⇡· eh
worst-case blocking bound determined by
ILP-solver
Explicit Accounting for Blocking
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
⌧
⌧
Ri = ei + bi +X
h<i
⇠Ri
ph
⇡· eh
uninflatedexecution costs
worst-case blocking bound determined by
ILP-solver
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
Explicit blocking termsILP formulation
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
Explicit blocking termsILP formulation
Explicit blocking termsILP formulation
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
So far we only talked about the MSRP...
So far we only talked about the MSRP...
...but there’s more.
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
Spin Lock Types
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
Spin Lock Types
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Prior analyses do not generalize
to other spin lock types without strong progress guarantees.
Prior Analyses Rely on Strong Progress Guarantees
FIFO-Ordering is analysis-friendly:
Each request can be blocked by at most one request for the same
resource from each other processor.
FIFO-Ordering is analysis-friendly:
Each request can be blocked by at most one request for the same
resource from each other processor.
Prior analyses rely on strong progress guarantees provided by FIFO-ordering.
Prior Analyses Rely on Strong Progress Guarantees
Each request can be blocked byall other requests
for the same resource.
Unordered spin locks:
Prior Analyses Rely on Strong Progress Guarantees
Explicit blocking termsILP formulation
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
Explicit blocking termsILP formulation
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.Wait-time bounds
Composable constraints
Explicit blocking termsILP formulation
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.Wait-time bounds
Composable constraints
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Analysis ofUnordered Spin Locks
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Analysis ofUnordered Spin Locks
Can all of these really block T1’s request?
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Analysis ofUnordered Spin Locks
Can all of these really block T1’s request?
Observation:Two requests can only interfere if they were
pending at the same time.
Observation:Two requests can only interfere if they were
pending at the same time.
Analysis ofUnordered Spin Locks
Per-Request Wait-Time Bounds
How many remote request can be pending while T1’s request is
pending?
Bound wait time of T1’s request. [1]
How many remote request can be pending while T1’s request is
pending?
[1] K. Lakshmanan, D. Niz, and R. Rajkumar, “Coordinated task scheduling, allocation and synchronization on multiprocessors,” in RTSS’09, 2009.
Per-Request Wait-Time Bounds
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Bounding the Wait Time of Requests
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
T2’s response time
Bounding the Wait Time of Requests
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
worst-case wait time of T1’s request
Bounding the Wait Time of Requests
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Bounding the Wait Time of Requests
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Bounding the Wait Time of Requests
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Bounding the Wait Time of Requests
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
At most one of T2’s jobs can overlap with T1’s request.
Bounding the Wait Time of Requests
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
Bound number of conflicting requests.
At most one of T2’s jobs can overlap with T1’s request.
Bounding the Wait Time of Requests
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2
ILP ConstraintsUnordered Spin Locks
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
ILP ConstraintsUnordered Spin Locks
T1
T2
T3
P1
P2
t
P3
Executing Critical SectionSpinning
X2,1,1 X2,1,2 X2,1,3
X3,1,1 X3,1,2X3,1,1 +X3,1,2 1
X2,1,1 +X2,1,2 +X2,1,3 1
Same constraints for unordered and FIFO-ordered
spin locks.
ILP ConstraintsUnordered Spin Locks
Explicit blocking termsILP formulation
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.Wait-time bounds
Composable constraints
ChallengesPrior analysis is
pessimistic due to inflation.
Prior analysis is specific to non-preemptable
FIFO-ordered spin locks.
Explicit blocking termsILP formulation
Wait-time boundsComposable constraints
Evaluation
Evaluation
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Evaluation
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Could we reduce pessimism?
Evaluation
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Could we reduce pessimism?
Does the spin lock type matter at all?
Evaluation
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Could we reduce pessimism?
Does the spin lock type matter at all?
Which type should we use?
Evaluation
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Could we reduce pessimism?
Does the spin lock type matter at all?
When can unordered locks be used?
Which type should we use?
Evaluation
Priority-Ordered
Unordered
Priority-Orderedwith FIFO tie-breaking
FIFO-ordered(MSRP)
PreemptableSpinning
Non-PreemptableSpinning
Could we reduce pessimism?
Which type should we use?
Does the spin lock type matter at all?
Should spinning be preemptable or
non-preemptable?
When can unordered locks be used?
Large-scale schedulability experiments:•number of processors : 4, 8, 16•average task utilization: 0.1, 0.2, 0.3• critical section lengths: , •number of resources: •number of requests: 1, 2, 5, 10, 15• resource sharing factors: 0.1, 0.25, 0.4, 0.75
Evaluation
[1µs, 15µs] [1µs, 100µs]
m
m/2, m, 2m
Large-scale schedulability experiments:•number of processors : 4, 8, 16•average task utilization: 0.1, 0.2, 0.3• critical section lengths: , •number of resources: •number of requests: 1, 2, 5, 10, 15• resource sharing factors: 0.1, 0.25, 0.4, 0.75
Evaluation
[1µs, 15µs] [1µs, 100µs]
m
m/2, m, 2m
1296 different configurations
Large-scale schedulability experiments:•number of processors : 4, 8, 16•average task utilization: 0.1, 0.2, 0.3• critical section lengths: , •number of resources: •number of requests: 1, 2, 5, 10, 15• resource sharing factors: 0.1, 0.25, 0.4, 0.75
Evaluation
[1µs, 15µs] [1µs, 100µs]
m
m/2, m, 2m
1296 different configurations
≥1000 samples per data point
in each configuration
Schedulability Experiments
#tasks
less idle timemore contention
fract
ion
of s
ched
ulab
le
task
set
s
Schedulability Experiments
#tasks
less idle timemore contention
fract
ion
of s
ched
ulab
le
task
set
s
higher is better
Notation
F|N
Notation
F|N
FIFO-ordered
Notation
F|N
Non-preemptable
Notation
Type Ordering
F|N FIFO-ordered non-preemptable
P|N Priority-ordered non-preemptable
U|N Unordered non-preemptable
PF|N Priority-ordered non-preemptable with FIFO tie-breaking
Does the new analysis reduce pessimism?
Does the new analysis reduce pessimism?
Configuration: 16 CPUs, avg. utilization: 0.1, 16 shared resources, CS lengths , at most 2 requests per resource, contention = 0.4[1µs, 15µs]
0
0.2
0.4
0.6
0.8
1
40 60 80 100 120 140
schedula
ble
number of tasks
MSRP-classicMSRP-holistic
F|N
0
0.2
0.4
0.6
0.8
1
40 60 80 100 120 140
schedula
ble
number of tasks
MSRP-classicMSRP-holistic
F|N
Configuration: 16 CPUs, avg. utilization: 0.1, 16 shared resources, CS lengths , at most 2 requests per resource, contention = 0.4[1µs, 15µs]
classic analysis
Does the new analysis reduce pessimism?
0
0.2
0.4
0.6
0.8
1
40 60 80 100 120 140
schedula
ble
number of tasks
MSRP-classicMSRP-holistic
F|N
Configuration: 16 CPUs, avg. utilization: 0.1, 16 shared resources, CS lengths , at most 2 requests per resource, contention = 0.4[1µs, 15µs]
classic analysis
Does the new analysis reduce pessimism?
holistic analysis [1]
[1] B. Brandenburg, “Scheduling and locking in multiprocessor real-time operating systems,” Ph.D. dissertation, The University of North Carolina at Chapel Hill, 2011.
0
0.2
0.4
0.6
0.8
1
40 60 80 100 120 140
schedula
ble
number of tasks
MSRP-classicMSRP-holistic
F|N
Configuration: 16 CPUs, avg. utilization: 0.1, 16 shared resources, CS lengths , at most 2 requests per resource, contention = 0.4[1µs, 15µs]
ILP-based analysis
classic analysis
Does the new analysis reduce pessimism?
holistic analysis [1]
[1] B. Brandenburg, “Scheduling and locking in multiprocessor real-time operating systems,” Ph.D. dissertation, The University of North Carolina at Chapel Hill, 2011.
0
0.2
0.4
0.6
0.8
1
40 60 80 100 120 140
schedula
ble
number of tasks
MSRP-classicMSRP-holistic
U|N
Configuration: 16 CPUs, avg. utilization: 0.1, 16 shared resources, CS lengths , at most 2 requests per resource, contention = 0.4[1µs, 15µs]
ILP-based analysis of unordered spin lock
classic analysis
Does the new analysis reduce pessimism?
holistic analysis [1]
[1] B. Brandenburg, “Scheduling and locking in multiprocessor real-time operating systems,” Ph.D. dissertation, The University of North Carolina at Chapel Hill, 2011.
0
0.2
0.4
0.6
0.8
1
40 60 80 100 120 140
schedula
ble
number of tasks
MSRP-classicMSRP-holistic
U|N
Configuration: 16 CPUs, avg. utilization: 0.1, 16 shared resources, CS lengths , at most 2 requests per resource, contention = 0.4[1µs, 15µs]
ILP-based analysis of unordered spin lock
classic analysis holistic analysis [1]
[1] B. Brandenburg, “Scheduling and locking in multiprocessor real-time operating systems,” Ph.D. dissertation, The University of North Carolina at Chapel Hill, 2011.
Does the new analysis reduce pessimism?
Less pessimismwith
new blocking analysis
Does the Spin Lock Type matter?
Does the Spin Lock Type matter?
Does the Spin Lock Type matter?
Spin lock type hassignificant impact on schedulability.
When can unordered locks be used?
When can unordered locks be used?
When can unordered locks be used?
When can unordered locks be used?
Task sets schedulable regardless of spin lock type
When can unordered locks be used?
Task sets schedulable regardless of spin lock type
Enables use of simpler algorithms and
cheaper hardware!
Handling Unknown Spin Lock Types
Analysis for unordered spin locks makes
no ordering assumptions
Handling Unknown Spin Lock Types
Analysis for unordered spin locks makes
no ordering assumptions
Analysis for unordered spin locks applicable for unknown types!
What is the impact of allowing preemptable spinning?
What is the impact of allowing preemptable spinning?
Preemptable spinning can...
Preemptable spinning can...
What is the impact of allowing preemptable spinning?
...decrease schedulability(FIFO-ordered)
Preemptable spinning can...
What is the impact of allowing preemptable spinning?
...decrease schedulability(FIFO-ordered)
...increase schedulability(priority-ordered)
Summaryand
Conclusions
Spin lock type has significant impact on
schedulability.
Specifyspin lock type
Suggested API changes
Spin lock type has significant impact on
schedulability.
Specifyspin lock type
FIFO- and priority ordering required to
support many workloads.
Support FIFO and priority ordering in
AUTOSAR
Suggested API changes
Spin lock type has significant impact on
schedulability.
Specifyspin lock type
FIFO- and priority ordering required to
support many workloads.
Preemptable spinning can improve schedulabiliy.
Support FIFO and priority ordering in
AUTOSAR
Support preemptable spinning with
ordering guarantees
Suggested API changes
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
Novel blocking analysis for spin locks:
⌧
⌧
Summary
support for 8 spin lock types
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
Novel blocking analysis for spin locks:
⌧
⌧
Summary
support for 8 spin lock types
...including unordered locks:
safe for unknown types
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
Novel blocking analysis for spin locks:
⌧
⌧
Summary
support for 8 spin lock types
...including unordered locks:
safe for unknown types
asymptotically less pessimistic
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
Novel blocking analysis for spin locks:
⌧
⌧
Summary
support for 8 spin lock types
...including unordered locks:
safe for unknown types
suggestions for AUTOSAR
response-timeanalysis
with uninflated execution times
inflation-freeblocking analysis
Novel blocking analysis for spin locks:
asymptotically less pessimistic
⌧
⌧
Summary
Future Work
Current analysis assumes non-nested critical sections.
Current analysis assumes non-nested critical sections.
Nested critical sections:work in progress
Future Work
Fin