Inbyggda realtidssystem: En flerkärning frälsning
Embedded real-time systems: A multi-core salvation
Thomas Nolte, 2013-04-25
1997 – 2000 – 2006 – 2009 – 2012Undergrad.
StudentGrad./PHD
StudentAssistant Professor
Associate Professor
ProfessorABB CRC
2002 2005, 2006
3
5
Embedded systems
Environment
Control program
sensors
actuators
TaskTask
TaskTask
CPU
Key properties of interest = performance & predictability
6
Embedded systems
8
9
Too EARLY inflation
Too LATE inflation
Perfect TIMING
Environment Control program
sensors
actuators
TaskTask
TaskTask
When software is executing, it is executing as tasks
void foo(){
…while(status){
in = read_sensor();action = take_action(in);…status = perform_action(action);sleep(1000);
}}
Task
11
12
Instruction and data memory (1)
13
Instruction and data memory (2)
DATA
INSTRUCTION
void foo(){
…while(status){
in = read_sensor();action = take_action(in);…status = perform_action(action);sleep(1000);
}}
Task
14
Instruction and data memory (3)
cache memory
15
Instruction and data memory (4)
cache memory
Key properties of interest = performance & predictability
A simple model
Environment Control program
sensors
actuators
TaskTask
TaskTask
task task task
time
period
worst-case execution time
16
What to run and when
Environment Control program
sensors
actuators
TaskTask
TaskTask
task1 task1 task1
time
task2 task2 task2
time
task2
prio low
prio high
time
task2 task2 task2 task2task1 task1 task1
The scheduler decides which task to execute
17
Determining the response time
Environment Control program
sensors
actuators
TaskTask
TaskTask
time
task2 task2 task2 task2task1
preempted preempted
resumed resumed
finished
response time of task1
response timeof task2
18
Predictability wrt embedded control systems● Program, or task
● Instruction for how the computer should work, i.e., what the computer shall do
● Execution time● How long time it takes for the program/task to
execute
● Response time● How long time it takes for the program/task to
execute to completion, also when running together with other programs/tasks
● Research conducted the past 30 yearsPretty good understanding how predictable embedded systems should be constructed
19
The multi-core arrived!● Isn’t more better?
The Free Lunch Is Over A Fundamental Turn Toward Concurrency in SoftwareBy Herb Sutter
21
22
The multi-core revolution
single core dual core quad core multi core
parallel computer = many cores
23
Multi-core memory hierarchy (1)
24
Multi-core memory hierarchy (2)
Challenges with many cores
● Sequential guarantee is not valid anymore● Programs could previously execute in parallel, but
at any given time only one program is executing
● Now at any given point in time as many programs as there are cores can be executing
25
pgm1
timepgm2 pgm2 pgm2
time
pgm2
Core 1
Core 2
pgm2 pgm2 pgm2 pgm2pgm1
time
Core
Performance on a parallel machine (1)● The way we construct programs become
different
26
100 chefs do not bake 1 cake 100x
faster than 1 chef
Performance on a parallel machine (2)● The way we execute programs become
different
27
pgm1
time
Core pgm1 pgm1
100
5149
pgm2
51
Performance on a parallel machine (3)● The way we execute programs become
different
28
pgm1
timepgm2 pgm2 pgm2
time
Core 1
Core 2
pgm1 pgm1
100 51
50%
Performance on a parallel machine (4)● The way we execute programs become
different
29
timepgm2 pgm2 pgm2
time
Core 1
Core 2
pgm1 pgm1 pgm1pgmj pgmj pgmj
Predictability under parallelism (1)● New techniques are required to resolve
conflicts
30
pgm1
timepgm2 pgm2 pgm2
time
pgm2
Core 1
Core 2
Predictability under parallelism (2)● New techniques are required to resolve
conflicts
31
pgm1
timepgm2 pgm2 pgm2
time
pgm2
Core 1
Core 2
shared memory
Predictability under parallelism (3)● New techniques are required to resolve
conflicts
32
pgm1
timepgm2 pgm2 pgm2
time
pgm2
Core 1
Core 2
shared memory
…and the many-core is here!● More is better?
34
EpophanyTM Multi-core Solution
single core dual core many core
76421
654321
53
1 2 3 4 5 6 7
emptycore
7
• task scheduling • task partitioning• task scheduling
• local• global
• task partitioning• task scheduling• idle?
1 2 3 4 5 6 7assume 7 tasks:
35
New challenges
task0
task1
task2
task3
task4
task5
task6
task7
task8
task9
• Less shared state and data among cores• Locality important when sharing data• More message passing (via powerful interconnects)•Sleep cores when idle to save power
Our efforts wrt. multi/many-core
● New ways to program and analyze● Meng Liu (PhD Student)● Hamid Reza Faragardi (PhD Student)
● New ways to partition and design● Moris Behnam (Senior Lecturer)● Daniel Hallmans (PhD Student)
● New ways to execute● Mikael Åsberg (PhD Student)● Nima M. Khalilzad (PhD Student)
● New ways to communicate and synchronize● Mohammad Ashjaei (PhD Student)● Sara Afshar (PhD Student)
37
PhD studen
t
Post-doc
Key CORE main research areas (2013): Multi-core and many-core real-time systems Real-time systems scheduling and
synchronization Predictable execution of real-time systems Compositional execution and analysis of real-
time systems
Simulation-based analysis of embedded systems
Stochastic and statistical analysis of real-time systems
Real-time communications Adaptive and reconfigurable real-time
systemsCORE alumni:
The Complex Real-Time Embedded (CORE) research group:
Mikael Åsberg Nima M. Khalilzad Daniel Hallmans Mohammad Ashjaei Sara Afshar Meng Liu
Kristian Sandström Moris Behnam Thomas Nolte Hamid R. FaragardiTBD TBD
Insik Shin Holger Kienle Johan Kraft Farhang Nemati Yue Lu Anders Wall
Embedded real-time systems: A multi-core salvationThomas Nolte, 2013-04-25