Weitere ähnliche Inhalte Ähnlich wie Cots moves to multicore: Wind River (20) Cots moves to multicore: Wind River1. COTS Moves to Multicore:
Software Considerations to Ease
the Transition To Multi-core
Chris Ault, Senior Product Manager – Wind River
3. Migrating from Single-Core to Multi-core
Performance:
– There may be increases
– There may be decreases
• Data dependencies
• Race conditions
Programming Model
– Revisit your synchronization assumptions
– There is shared hardware in there!
Algorithms: need to be multi-core-aware
3 | © 2010 Wind River. All Rights Reserved.
4. Migrating from Single-Core to Multi-core
Shared hardware on the board
OS privilege levels: multiple
instances of the kernel, one per core
4 | © 2010 Wind River. All Rights Reserved.
5. Multi-core: Shared Hardware Resources
All cores share access to
– I/O devices
– Memory
– Timers/clocks
– Interrupt controller
Core Core Core Core
Interrupt Controller
IDE Ethernet Timer Serial Memory
5 | © 2010 Wind River. All Rights Reserved.
6. Privilege Modes: Single-Core
Operating systems work in privilege modes:
The OS kernel itself can do anything with the hardware
Device drivers are more restricted
User applications/components are least privileged
Ring 3
Ring 2 Least Privileged
Ring 1
Ring 0
AMP
Kernel
Example based on Intel
privilege rings, other
processors have similar
Device Drivers concepts
Device Drivers
Most Privileged
Applications
Intel privilege rings source: Wikipedia
6 | © 2010 Wind River. All Rights Reserved.
7. Privilege Modes and Multi-core
Cores in privilege mode can control the entire hardware
and mask interrupts
More control may be required in a multi-core setting
Can seriously impacts robustness
Ring 3 Ring 3 Ring 3 Ring 3
Ring 2 Ring 2 Ring 2 Ring 2
Ring 1 Ring 1 Ring 1 Ring 1
Ring 0 Ring 0 Ring 0 Ring 0
SMP
Kernel Kernel Kernel Kernel
Device Drivers Device Drivers Device Drivers Device Drivers
Device Drivers Device Drivers Device Drivers Device Drivers
Applications Applications Applications Applications
Core Core Core Core
7 | © 2010 Wind River. All Rights Reserved.
8. SMP Operating System
Review Your Assumptions
Multiple instances of tasks running at the same priority
Lower priority tasks running concurrently with higher
priority tasks
Lower priority tasks may mask interrupts and starve
higher priority tasks
8 | © 2010 Wind River. All Rights Reserved.
9. Algorithms, Data Parallelism
Traditional Single-core systems:
– Single instance of processing task operates on complete data
set
– Does not utilize all cpu cores
Data Set
Core
Idle cores
Core
Data
Core Processing
Core
9 | © 2010 Wind River. All Rights Reserved.
10. Data Parallelism
Multiple instances of data processing, operating on
smaller subsets of data
Multi-core-aware algorithms are necessary to realize
increases in processing speed
– Re-architect & re-write code
Data Subsets
Core Data Processing
Core Data Processing
Core Data Processing
Core Data Processing
10 | © 2010 Wind River. All Rights Reserved.
11. Complex Challenges When Migrating To
Multi-core
Shared hardware on the board
– I/O devices, memory, interrupt controller
Non-parallel code needs to be re-written, re-
tested
OS privilege levels: multiple instances of the
kernel, one per core
11 | © 2010 Wind River. All Rights Reserved.
12. It’s Not All That Gloomy ….
With Embedded Virtualization …..
Virtualize accesses to shared
hardware
– Shared access is controlled outside
of your app
– Interrupt controller, memory regions, Apps Apps
Apps Apps
devices
Retain execution behavior of OS OS
existing apps Hypervisor
– Minimize retesting/rewriting
Core 1 Core 2
Add new functionality on
remaining cores
12 | © 2010 Wind River. All Rights Reserved.