Simso: A Simulation Tool To Evaluate Real-Time Multiprocessor Scheduling Algorithms
Simso: A Simulation Tool To Evaluate Real-Time Multiprocessor Scheduling Algorithms
SimSo
Example
Conclusion and Future Work
July 8, 2014
5th International Workshop on Analysis Tools
and Methodologies for Embedded and Real-time Systems (WATERS)
1 Objective
2 SimSo
3 Example
1 Objective
2 SimSo
3 Example
Problem Denition
Schedule
τ1 τ2 CPU1 τ1 τ2 τ3 τ1
t
τ3 τ4
CPU2 τ5 τ4 τ2 τ5
τ5 t
Independent Multiprocessor
and periodic tasks Architecture
Objective
To evaluate their behavior and performance.
5 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo
Example
Conclusion and Future Work
Several Approaches
Theoretical analysis
Good way to prove schedulability, but hard to take into
consideration some aspects
Empirical studies on real systems
Realistic. But require a signicant amount of time and skills to
handle the tools and the results are specic to a certain platform
Simulations
Easy to use and very exible but less accurate than a real system
1 Objective
2 SimSo
3 Example
SimSo 1
1
Simulation of Multiprocessor Scheduling with Overheads
8 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work
I G-EDF (WCET)
RUN (WCET)
2000
common metrics
500
20 tasks
40
0 24 tasks
70 75 80 85 90 95 100
30 tasks
Utilization
20 (%)
40 tasks
50 tasks
I Utilization (%)
Very exible
Require to develop and learn the programming interfaces
10 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo Overview
Example Experimenting with SimSo
Conclusion and Future Work
Software Architecture
Discrete-Event Simulation
SimSo is based on SimPy, a process-based discrete-event simulator.
Main classes
→ Control the state of the jobs (run/wait)
→ Call the methods of the scheduler
Model
→ Simulate a job execution
init()
launch
→ Signal
Process the processor
objects launch
when ready or nished
on_activate(job) migration
→ User-provided class that Task
→ Create the objects and launch the simulation
event
schedules the jobs
on_terminated(job)
→ Release the jobs launch
→ Allow to set(job,cpu)
up timers as in a real system
activated event
Job
schedule event terminated event
launch Timer
Software Architecture
Software Architecture
Writing a Scheduler
Interface
Scheduler
A scheduler for SimSo is a Python class that Attributes:
inherits from the abstract class Scheduler.
sim
processors
task_list
...
Methods:
This class is loaded dynamically in SimSo init()
on_activate(job)
Example
Available Schedulers
Uniprocessor
RM, DM, FP, EDF, LLF, M-LLF, Static-EDF, CC-EDF
Partitioned
Any uniprocessor scheduler combined with various bin packing
algorithms (Best Fit, First Fit, Next Fit, Worst Fit...)
Global
G-RM, G-EDF, G-FL, EDF-US, PriD, EDZL, LLF, M-LLF, U-EDF
PFair: PD2 , ER-PD2
DP-Fair and BFair: LLREF, LRE-TL, DP-WRAP, BF, NVNLF
Semi-Partitioned
EDHS, EKG, RUN
Generation of Tasksets
Task utilization
The following generators are available:
I RandFixedSum
I UUniFast-Discard
Task periods
The periods can be generated using:
I Uniform distribution
I Log-Uniform distribution
Generation of Tasksets
Simulation
Speed
SimSo is able to run thousands simulations per hour
(depending on the scheduler and system conguration).
Simulation output
Output
The output of the simulation is a trace of the events that occurred.
Analysis
It is possible to parse the trace to retrieve any specic metric.
But, in order to ease the retrieval of usual metrics, some functions are
provided.
1 Objective
2 SimSo
3 Example
Objective
2
with K=number of processors
22 / 31 Chéramy, Hladik and Déplanche SimSo: Simulation of Real-Time Scheduling
Objective
SimSo
Example
Conclusion and Future Work
Parameters
I Number of tasks: 20, 30, 40, 50, 60, 70, 80, 90, 100
I Number of processors: 2, 4, 8
I System utilization: 85%, 95%
I Periods: log-uniform distribution in [2, 100ms]
I Simulation on [0, 1000ms]
I Execution Time Model: ACET (average value=75% of WCET)
Simulations
For each conguration (tasks, processors, utilization), 20 tasksets are
generated.
Simulation
Duration
5400 simulations executed in ∼2 hours.
Collection of the results
The number of preemptions and migrations are extracted from
each simulation and stored in an SQLite3 database.
Analysis
Results
Preemptions and migrations depending on the number of tasks.
Results for 8 processors and a total utilization of 95%:
10000
G-EDF
Number of migrations
6000 NVNLF
RUN
4000 U-EDF
2000
0
20 30 40 50 60 70 80 90 100 20 30 40 50 60 70 80 90 100 20 30 40 50 60 70 80 90 100
Number of tasks Number of tasks Number of tasks
Analysis
A few comments
I EKG generates a lot of migrations
I the results of NVNLF are getting better with more processors
I G-EDF gives the best results but a few jobs missed their deadline
I RUN acts as a partitioned scheduler with more than 30 tasks
I RUN and U-EDF results are good
10000
G-EDF
Sum preemptions and migrations EKG
8000
Number of preemptions
Number of migrations
6000 NVNLF
RUN
4000 U-EDF
2000
0
20 30 40 50 60 70 80 90 100 20 30 40 50 60 70 80 90 100 20 30 40 50 60 70 80 90 100
Number of tasks Number of tasks Number of tasks
Analysis
Possible improvements
I EKG could do less migrations with a better choice of K and
with other improvements
I the implementation of RUN could benet from minor
improvements (see paper about RUN presented at ECRTS)
I U-EDF could probably do better with clustering or with
some improvements (eg. by using the idle times)
1 Objective
2 SimSo
3 Example
Improvement in SimSo
Inclusion of other task models (eg. task dependencies, sporadic tasks).
Experiments
SimSo was used to run approximatively 500 000 simulations.
Conclusion
SimSo
SimSo is a simulator dedicated to the evaluation of scheduling
algorithms.
Questions?