SlideShare a Scribd company logo
© 2013 Toshiba Corporation
An Essential Relationship between
Real-time and Resource Partitioning
2013/10/25
Yoshitake Kobayashi
Advanced Software Technology Group
Corporate Software Engineering Center
TOSHIBA CORPORATION
4Embedded Linux Conference Europe 2013
Overview
 Background
 Requirement
 Hardware resource partitioning
 Summary
5Embedded Linux Conference Europe 2013
Background
 Hardware
 Multi-core CPU
 Larger memory
 Larger storage space
 Hardware assisted virtualization
 Software
 Operating system
 Linux
 Virtual Machine Monitor
6Embedded Linux Conference Europe 2013
Background
 Hardware
 Multi-core CPU
 Larger memory
 Larger storage space
 Hardware assisted virtualization
 Software
 Operating system
 Linux
 Virtual Machine Monitor
 Issues on real-time systems
 Meet its required deadline
 ex. Control systems
 Performance requirement
 Interrupt latency
 Response time
7Embedded Linux Conference Europe 2013
Requirement (1)
 All Real-time application should meet its real-
time constrain
 Response time (Deadline): 100μs – 100ms
 Event response time (Interrupt latency): 10μs – 100μs
Wakeup time
Process time
Deadline
Period
Event response time
Wakeup time
8Embedded Linux Conference Europe 2013
Requirement (2)
 A system needs to be able to run both real-time
(RT) application and general purpose (GP)
application at same time
9Embedded Linux Conference Europe 2013
A sample of current implementation
 Prepare two hardware
 Implement RT application on a specific one
 Implement GP application on other one
 Connect each other by a bus or share memory
CPU
Devices
Linux kernel
Real time process General purpose processes
RTOS BUS
10Embedded Linux Conference Europe 2013
 A system software able to control RT and GP
 System software: OS, VMM
Requirement (3): Make a simple world
CPU
Devices
System Software
Real time process General purpose processes
11Embedded Linux Conference Europe 2013
Hybrid OS vs. Single OS approach
12Embedded Linux Conference Europe 2013
Hybrid OS vs. Single OS approach
 Hybrid OS
 Two or more operating systems runs on same hardware
 RT specific tasks run on RTOS (Real-Time Operating System) and the
other tasks runs on GPOS (General Purpose Operating System)
 ex. uITRON for RTOS and Linux for GPOS
 Possible implementations
 By VMM
 Run GPOS as a task on RTOS
 RTOS and GPOS have different APIs
 Xenomai
 Single OS
 Just use one OS to run both RT and GP applications
 Same API can be used for all applications
 Possible implementations
 Kernel level RT process
 RT-Preempt patch
13Embedded Linux Conference Europe 2013
Hybrid architecture (Xenomai)
 Xenomai
 Reference: http://www.xenomai.org
 Dual kernel approach based on Adeos/I-Pipe
 I-Pipe works to dispatch events (ex. Interrupts)
 Xenomai skins build on top of the Xenomai nucleus to provide
RTOS APIs such as VxWoks, uITRON
Adeos/I-Pipe
Linux
Xenomai nucleus
devices
Skins
14Embedded Linux Conference Europe 2013
Hybrid architecture (TOPPERS SafeG)
 SafeG (Safety Gate)
 Reference: http://www.toppers.jp/en/safeg.html
 Dual-OS monitor
 Execute an RTOS (Real-Time Operating System) and a GPOS
(General-Purpose Operating System) on the same hardware
platform
 ARM TrustZone security extensions uses to introduce the concept
of Trust and Non-Trust states
 On the other hand, code running under Non-Trust state, even in
privileged mode, cannot access memory space (devices included)
that was allocated for Trust state usage, nor can it execute
certain instructions that are considered critical.
SafeG
LinuxRTOS (uITRON)
IRQ devicesFIQ devices
15Embedded Linux Conference Europe 2013
Hybrid OS vs. Single OS approach
 Hybrid OS
 More than one OS runs on same hardware
 RT specific tasks run on RTOS (Real-Time Operating System) and the
other tasks runs on GPOS (General Purpose Operating System)
 ex. Linux and uITRON
 Possible implementations
 By VMM
 Run GPOS as a task on RTOS
 RTOS and GPOS have different APIs
 Xenomai
 Single OS
 Just use one OS to run both RT and GP applications
 Same API can be used for all applications
 Possible implementations
 Kernel level RT process
 RT-Preempt patch
16Embedded Linux Conference Europe 2013
Actual requirement (3): Linux
 Linux runs both RT and GP applications
CPU
Devices
Linux
Real time process General purpose processes
17Embedded Linux Conference Europe 2013
Summary of requirements
1. Run RT processes and GP processes on a
hardware platform
2. Need to meet required deadlines
 One of the most important perspective for embedded
systems
3. Use single OS approach
 Linux
18Embedded Linux Conference Europe 2013
Actual requirement (3): Linux
 Linux runs both RT and GP applications
 This is not a good idea if you don’t care anything
CPU
Devices
Linux
Real time process General purpose processes
19Embedded Linux Conference Europe 2013
Issues to run RT process and GP process
 Determinism
 RT process should have a deterministic behavior
 GP process doesn’t assume deterministic behaviour
20Embedded Linux Conference Europe 2013
 Real-time Preemption Patch
 Fully preemptive kernel
 Improvement for latency
 CPU affinity
 Prohibit process migration from one core to another
 Protect from GP process behaviour
 Maybe good for determinism
How to improve real time performance?
RT CPU core GP CPU core
RT thread
RTタスクGP thread
GP thread
Scheduler Scheduler
RT thread
RT thread
Effects by workload
21Embedded Linux Conference Europe 2013
 Partition is a set of hardware resource
 CPU cores, Memory, Devices, ..
 Each partition must be isolated from the others
 No device sharing
Definition of hardware resource partitioning
CPU
Devices
Linux kernel
Real time processes General purpose processes
22Embedded Linux Conference Europe 2013
A use case of CPU affinity for RT process
 Run a set of process and thread on specific CPU
core
Advantage
 No process migration
 Process migration is not friendly with real time behviour
 Migration timing cannot be expected
 Just RT process runs on specific cores
 Isolate all GP process into the other cores
CPU core 1 CPU core 2
RT process
23Embedded Linux Conference Europe 2013
0
20
40
60
80
100
120
140
160
180
200
0 20 40 60 80 100120140160180200220240260280300320340360380400420440460480
Numberofsamples
0
10
20
30
40
50
60
70
80
90
100
0 20 40 60 80 100120140160180200220240260280300320340360380400420440460480
NumberofsamplesEvaluation of interrupt latency with CPU affinity
 Evaluation environment
 Hardware: Pandaboard
 Period: 300μs
Interrupt letency [us]
CPU Affinity
W/O CPU
Affinity
24Embedded Linux Conference Europe 2013
0
20
40
60
80
100
120
140
160
180
200
0 20 40 60 80 100120140160180200220240260280300320340360380400420440460480
Numberofsamples
0
10
20
30
40
50
60
70
80
90
100
0 20 40 60 80 100120140160180200220240260280300320340360380400420440460480
NumberofsamplesEvaluation of interrupt latency with CPU affinity
0
10
20
30
40
50
60
70
80
90
100
0 100 200 300 400 500 600 700 800 900
Numberofsamples
CPU Affinity
(in some case)
CPU Affinity
W/O CPU Affinity
25Embedded Linux Conference Europe 2013
Period
?
What’s occurred?
Timer cascade
occurs here
26Embedded Linux Conference Europe 2013
CPU core 0
Process
CPU core specific
kernel thread
CPU core 1
Kernel thread
Process
Kernel thread
CPU core specific
kernel thread
Limitation of CPU affinity
 Example for CPU core specific kernel thread
 Timer, High resolution timer
 Process migration
 Etc..
27Embedded Linux Conference Europe 2013
List 1 List 2 List 3 List 4 List 5
Inside the each entry
Timer 1 Timer 2 ・・・
cascade()
Cascade timer list
 Cascade timer
 Register the next timer list to the end of current one
 Impact of cascade timer to interrupt latency
 Runs with interrupt disabled context
 No limits for the number of timers
 Timer process cost becomes higher when tickless kernel used
28Embedded Linux Conference Europe 2013
Control cascade timers on RT CPU core
 Solution
 Keep the timer list empty on RT core to protect from cascade
timers
RT CPU core
timer.c
GP CPU core
Timer
timer.c
Timer
Timer list (Empty) Timer list
Kernel thread
29Embedded Linux Conference Europe 2013
RT CPU core
Kernel thread
__run_timers()
GP CPU core
timer
__run_timers()
Kernel thread
Timer list Timer list
Core specific
kernel thread
Timer
Timer
(Ⅲ)
(Ⅱ) (Ⅰ)
Three issues which cause cascade timers
(Ⅰ) Registered by GP process before migration
(Ⅱ) Registered by RT Core specific kernel thread
(Ⅲ) Registered by RT Core specific kernel thread
before RT task runs
Expired timers
causes cascade
30Embedded Linux Conference Europe 2013
RT core
Kernel thread
timer.c
GP core
Timer
timer.c
Timer
Kernel thread
Timer list Timer list
(イ)
(A)
(B)
Solution for the issue (Ⅰ)
 Preparation
 Log all timer registration by kernel thread
 Solution
(A) Migrate kernel threads or a GP processes to GP core
(B) Migrate registered times to GP core refer the log
(Timer migration)
31Embedded Linux Conference Europe 2013
RT core
timer.c
GP core
タイマ処理
Timer list Timer list
Core specific
kernel thread
Timer
Timer
(Ⅱ)
(Ⅲ)
Solution for the issues (Ⅱ) and (Ⅲ)
Restrict to resister
new timers to
the GP core only
Case 1: Not enough time to migrate
Wait for expiration
Case 2: Enough time to migrate
Migrate the timer to GP core
(Ⅱ) Registered by RT Core specific kernel thread
(Ⅲ) Registered by RT Core specific kernel thread before
RT task runs
32Embedded Linux Conference Europe 2013
①
②
Evaluation
① ②
Cascade occurs here
Before
After
33Embedded Linux Conference Europe 2013
Summary
 Requirement
 RT processes and GP processes on a same hardware platform
 Just use Linux for both processes
 Meet its required deadline for RT process
 Hardware resource partitioning
 Set of hardware resources which is isolated from the others
 Define CPU cores as RT core and GP core
 Issues to implement the resource partitioning
 Some kernel thread cannot be migrated
 Core specific kernel thread
 Need to care with CPU affinity feature
 Focused on cascade in timer.c
 Protect from cascade function on RT core
 Keep timer list empty
 Future plan
 Fixing issues
 SCHED_DEADLINE on RT core with fine granularity support
34
Questions?
The latest slide is available at the following URL:
http://elinux.org/ELC_Europe_2013_Presentations

More Related Content

PPTX
y2038 issue
SZ Lin
 
PDF
淺談 Live patching technology
SZ Lin
 
PDF
Kernel Recipes 2015 - The Dronecode Project – A step in open source drones
Anne Nicolas
 
PDF
Kernel Recipes 2015: Speed up your kernel development cycle with QEMU
Anne Nicolas
 
PDF
ebpf and IO Visor: The What, how, and what next!
Affan Syed
 
PDF
containerdの概要と最近の機能
Kohei Tokunaga
 
PDF
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
Linaro
 
PPT
Libpcap
liu qiang
 
y2038 issue
SZ Lin
 
淺談 Live patching technology
SZ Lin
 
Kernel Recipes 2015 - The Dronecode Project – A step in open source drones
Anne Nicolas
 
Kernel Recipes 2015: Speed up your kernel development cycle with QEMU
Anne Nicolas
 
ebpf and IO Visor: The What, how, and what next!
Affan Syed
 
containerdの概要と最近の機能
Kohei Tokunaga
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
Linaro
 
Libpcap
liu qiang
 

What's hot (20)

PDF
P2P Container Image Distribution on IPFS With containerd and nerdctl
Kohei Tokunaga
 
PDF
SGX Trusted Execution Environment
Kernel TLV
 
PDF
Mirko Damiani - An Embedded soft real time distributed system in Go
linuxlab_conf
 
PDF
BPF - All your packets belong to me
_xhr_
 
PDF
LAS16-101: Efficient kernel backporting
Linaro
 
PPTX
eBPF Basics
Michael Kehoe
 
PDF
BKK16-213 Where's the Hardware?
Linaro
 
PDF
Kernel Recipes 2015: Greybus
Anne Nicolas
 
PDF
Kernel Recipes 2015 - Kernel dump analysis
Anne Nicolas
 
PDF
Long-term Maintenance Model of Embedded Industrial Linux Distribution
SZ Lin
 
PDF
Automotive Grade Linux and systemd
Alison Chaiken
 
PDF
Kernel Recipes 2019 - Suricata and XDP
Anne Nicolas
 
PDF
BKK16-400A LuvOS and ACPI Compliance Testing
Linaro
 
PDF
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
Linaro
 
PDF
BKK16-308 The tool called Auto-Tuned Optimization System (ATOS)
Linaro
 
PPTX
LAS16-106: GNU Toolchain Development Lifecycle
Linaro
 
PDF
Luca Abeni - Real-Time Virtual Machines with Linux and kvm
linuxlab_conf
 
PDF
LAS16-209: Finished and Upcoming Projects in LMG
Linaro
 
PDF
BKK16-410 SoC Idling & CPU Cluster PM
Linaro
 
PDF
Comp architecture : branch prediction
rinnocente
 
P2P Container Image Distribution on IPFS With containerd and nerdctl
Kohei Tokunaga
 
SGX Trusted Execution Environment
Kernel TLV
 
Mirko Damiani - An Embedded soft real time distributed system in Go
linuxlab_conf
 
BPF - All your packets belong to me
_xhr_
 
LAS16-101: Efficient kernel backporting
Linaro
 
eBPF Basics
Michael Kehoe
 
BKK16-213 Where's the Hardware?
Linaro
 
Kernel Recipes 2015: Greybus
Anne Nicolas
 
Kernel Recipes 2015 - Kernel dump analysis
Anne Nicolas
 
Long-term Maintenance Model of Embedded Industrial Linux Distribution
SZ Lin
 
Automotive Grade Linux and systemd
Alison Chaiken
 
Kernel Recipes 2019 - Suricata and XDP
Anne Nicolas
 
BKK16-400A LuvOS and ACPI Compliance Testing
Linaro
 
BKK16-302: Android Optimizing Compiler: New Member Assimilation Guide
Linaro
 
BKK16-308 The tool called Auto-Tuned Optimization System (ATOS)
Linaro
 
LAS16-106: GNU Toolchain Development Lifecycle
Linaro
 
Luca Abeni - Real-Time Virtual Machines with Linux and kvm
linuxlab_conf
 
LAS16-209: Finished and Upcoming Projects in LMG
Linaro
 
BKK16-410 SoC Idling & CPU Cluster PM
Linaro
 
Comp architecture : branch prediction
rinnocente
 
Ad

Viewers also liked (17)

PDF
HKG15-305: Real Time processing comparing the RT patch vs Core isolation
Linaro
 
PDF
Overview of Linux real-time challenges
Daniel Stenberg
 
PDF
3G Transport Profile
Greengrass Generaltransport
 
PPTX
investigación cientifica
1005877079
 
PDF
Mastering Real-time Linux
Jean-François Deverge
 
PPTX
The new Wilson VH3300 Automated Knoop/Vickers Hardness Tester
Simone Hebel
 
PDF
Ineffective and Effective Ways To Find Out Latency Bottlenecks With Ftrace
Yoshitake Kobayashi
 
PDF
Improvement of Scheduling Granularity for Deadline Scheduler
Yoshitake Kobayashi
 
PPT
Huffman Tree And Its Application
Papu Kumar
 
PPTX
Cours4.1 recherche documentaire-outils
Evelyne Brémond
 
PPTX
Cours4.4 google
Evelyne Brémond
 
PDF
Making Linux do Hard Real-time
National Cheng Kung University
 
PDF
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg
 
PPTX
Broken Linux Performance Tools 2016
Brendan Gregg
 
PDF
Técnicas de análisis
María Concepción Rosales
 
PDF
Linux Performance Analysis and Tools
Brendan Gregg
 
PDF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Brendan Gregg
 
HKG15-305: Real Time processing comparing the RT patch vs Core isolation
Linaro
 
Overview of Linux real-time challenges
Daniel Stenberg
 
3G Transport Profile
Greengrass Generaltransport
 
investigación cientifica
1005877079
 
Mastering Real-time Linux
Jean-François Deverge
 
The new Wilson VH3300 Automated Knoop/Vickers Hardness Tester
Simone Hebel
 
Ineffective and Effective Ways To Find Out Latency Bottlenecks With Ftrace
Yoshitake Kobayashi
 
Improvement of Scheduling Granularity for Deadline Scheduler
Yoshitake Kobayashi
 
Huffman Tree And Its Application
Papu Kumar
 
Cours4.1 recherche documentaire-outils
Evelyne Brémond
 
Cours4.4 google
Evelyne Brémond
 
Making Linux do Hard Real-time
National Cheng Kung University
 
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg
 
Broken Linux Performance Tools 2016
Brendan Gregg
 
Técnicas de análisis
María Concepción Rosales
 
Linux Performance Analysis and Tools
Brendan Gregg
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Brendan Gregg
 
Ad

Similar to An Essential Relationship between Real-time and Resource Partitioning (20)

PDF
Using Embedded Linux for Infrastructure Systems
Yoshitake Kobayashi
 
PDF
2009-09-24 Get the Hype on System z Webinar with IBM, Current & Future Linux ...
Shawn Wells
 
PDF
Ceph Day Shanghai - On the Productization Practice of Ceph
Ceph Community
 
PDF
Time is ready for the Civil Infrastructure Platform
Yoshitake Kobayashi
 
PPT
Introduction to Real-Time Operating Systems
coolmirza143
 
PDF
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
Linaro
 
PDF
2009-10-07 IBM zExpo 2009, Current & Future Linux on System z
Shawn Wells
 
PPT
NWU and HPC
Wilhelm van Belkum
 
PPT
ucOS
Ramasubbu .P
 
ODP
Enduro/X Middleware
Madars Vitolins
 
ODP
ERTS 2008 - Using Linux for industrial projects
Christian Charreyre
 
PDF
20141111_SOS3_Gallo
Andrea Gallo
 
PDF
PowerDRC/LVS 2.2 released by POLYTEDA
Alexander Grudanov
 
PDF
Programming embedded systems ii
vtsplgroup
 
PPTX
QEMU - Binary Translation
Jiann-Fuh Liaw
 
PDF
App container rkt
Xiaofeng Guo
 
PDF
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus SDN/OpenFlow switch
 
PDF
LCA13: Who Disturbs My Slumber
Linaro
 
PPT
Four Ways to Improve Linux Performance IEEE Webinar, R2.0
Michael Christofferson
 
PPTX
2014/09/02 Cisco UCS HPC @ ANL
dgoodell
 
Using Embedded Linux for Infrastructure Systems
Yoshitake Kobayashi
 
2009-09-24 Get the Hype on System z Webinar with IBM, Current & Future Linux ...
Shawn Wells
 
Ceph Day Shanghai - On the Productization Practice of Ceph
Ceph Community
 
Time is ready for the Civil Infrastructure Platform
Yoshitake Kobayashi
 
Introduction to Real-Time Operating Systems
coolmirza143
 
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
Linaro
 
2009-10-07 IBM zExpo 2009, Current & Future Linux on System z
Shawn Wells
 
NWU and HPC
Wilhelm van Belkum
 
Enduro/X Middleware
Madars Vitolins
 
ERTS 2008 - Using Linux for industrial projects
Christian Charreyre
 
20141111_SOS3_Gallo
Andrea Gallo
 
PowerDRC/LVS 2.2 released by POLYTEDA
Alexander Grudanov
 
Programming embedded systems ii
vtsplgroup
 
QEMU - Binary Translation
Jiann-Fuh Liaw
 
App container rkt
Xiaofeng Guo
 
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Lagopus SDN/OpenFlow switch
 
LCA13: Who Disturbs My Slumber
Linaro
 
Four Ways to Improve Linux Performance IEEE Webinar, R2.0
Michael Christofferson
 
2014/09/02 Cisco UCS HPC @ ANL
dgoodell
 

More from Yoshitake Kobayashi (12)

PDF
InnerSource Learning Path (Japanese)
Yoshitake Kobayashi
 
PDF
Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...
Yoshitake Kobayashi
 
PDF
SLTS kernel and base-layer development in the Civil Infrastructure Platform
Yoshitake Kobayashi
 
PDF
Introducing the Civil Infrastructure Platform Project
Yoshitake Kobayashi
 
PDF
Introducing the Civil Infrastructure Platform
Yoshitake Kobayashi
 
PDF
The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
Yoshitake Kobayashi
 
PDF
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Yoshitake Kobayashi
 
PDF
Applying Linux to the Civil Infrastructure
Yoshitake Kobayashi
 
PDF
Using Real-Time Patch with LTSI Kernel
Yoshitake Kobayashi
 
PDF
Deadline Miss Detection with SCHED_DEADLINE
Yoshitake Kobayashi
 
PDF
Moving Forward: Overcoming Compatibility Issues BoFs
Yoshitake Kobayashi
 
PDF
Evaluation of Data Reliability on Linux File Systems
Yoshitake Kobayashi
 
InnerSource Learning Path (Japanese)
Yoshitake Kobayashi
 
Civil Infrastructure Platform: Industrial Grade SLTS Kernel and Base-layer De...
Yoshitake Kobayashi
 
SLTS kernel and base-layer development in the Civil Infrastructure Platform
Yoshitake Kobayashi
 
Introducing the Civil Infrastructure Platform Project
Yoshitake Kobayashi
 
Introducing the Civil Infrastructure Platform
Yoshitake Kobayashi
 
The Latest Status of CE Workgroup Shared Embedded Linux Distribution Project
Yoshitake Kobayashi
 
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Yoshitake Kobayashi
 
Applying Linux to the Civil Infrastructure
Yoshitake Kobayashi
 
Using Real-Time Patch with LTSI Kernel
Yoshitake Kobayashi
 
Deadline Miss Detection with SCHED_DEADLINE
Yoshitake Kobayashi
 
Moving Forward: Overcoming Compatibility Issues BoFs
Yoshitake Kobayashi
 
Evaluation of Data Reliability on Linux File Systems
Yoshitake Kobayashi
 

Recently uploaded (20)

PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Doc9.....................................
SofiaCollazos
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 

An Essential Relationship between Real-time and Resource Partitioning

  • 1. © 2013 Toshiba Corporation An Essential Relationship between Real-time and Resource Partitioning 2013/10/25 Yoshitake Kobayashi Advanced Software Technology Group Corporate Software Engineering Center TOSHIBA CORPORATION
  • 2. 4Embedded Linux Conference Europe 2013 Overview  Background  Requirement  Hardware resource partitioning  Summary
  • 3. 5Embedded Linux Conference Europe 2013 Background  Hardware  Multi-core CPU  Larger memory  Larger storage space  Hardware assisted virtualization  Software  Operating system  Linux  Virtual Machine Monitor
  • 4. 6Embedded Linux Conference Europe 2013 Background  Hardware  Multi-core CPU  Larger memory  Larger storage space  Hardware assisted virtualization  Software  Operating system  Linux  Virtual Machine Monitor  Issues on real-time systems  Meet its required deadline  ex. Control systems  Performance requirement  Interrupt latency  Response time
  • 5. 7Embedded Linux Conference Europe 2013 Requirement (1)  All Real-time application should meet its real- time constrain  Response time (Deadline): 100μs – 100ms  Event response time (Interrupt latency): 10μs – 100μs Wakeup time Process time Deadline Period Event response time Wakeup time
  • 6. 8Embedded Linux Conference Europe 2013 Requirement (2)  A system needs to be able to run both real-time (RT) application and general purpose (GP) application at same time
  • 7. 9Embedded Linux Conference Europe 2013 A sample of current implementation  Prepare two hardware  Implement RT application on a specific one  Implement GP application on other one  Connect each other by a bus or share memory CPU Devices Linux kernel Real time process General purpose processes RTOS BUS
  • 8. 10Embedded Linux Conference Europe 2013  A system software able to control RT and GP  System software: OS, VMM Requirement (3): Make a simple world CPU Devices System Software Real time process General purpose processes
  • 9. 11Embedded Linux Conference Europe 2013 Hybrid OS vs. Single OS approach
  • 10. 12Embedded Linux Conference Europe 2013 Hybrid OS vs. Single OS approach  Hybrid OS  Two or more operating systems runs on same hardware  RT specific tasks run on RTOS (Real-Time Operating System) and the other tasks runs on GPOS (General Purpose Operating System)  ex. uITRON for RTOS and Linux for GPOS  Possible implementations  By VMM  Run GPOS as a task on RTOS  RTOS and GPOS have different APIs  Xenomai  Single OS  Just use one OS to run both RT and GP applications  Same API can be used for all applications  Possible implementations  Kernel level RT process  RT-Preempt patch
  • 11. 13Embedded Linux Conference Europe 2013 Hybrid architecture (Xenomai)  Xenomai  Reference: http://www.xenomai.org  Dual kernel approach based on Adeos/I-Pipe  I-Pipe works to dispatch events (ex. Interrupts)  Xenomai skins build on top of the Xenomai nucleus to provide RTOS APIs such as VxWoks, uITRON Adeos/I-Pipe Linux Xenomai nucleus devices Skins
  • 12. 14Embedded Linux Conference Europe 2013 Hybrid architecture (TOPPERS SafeG)  SafeG (Safety Gate)  Reference: http://www.toppers.jp/en/safeg.html  Dual-OS monitor  Execute an RTOS (Real-Time Operating System) and a GPOS (General-Purpose Operating System) on the same hardware platform  ARM TrustZone security extensions uses to introduce the concept of Trust and Non-Trust states  On the other hand, code running under Non-Trust state, even in privileged mode, cannot access memory space (devices included) that was allocated for Trust state usage, nor can it execute certain instructions that are considered critical. SafeG LinuxRTOS (uITRON) IRQ devicesFIQ devices
  • 13. 15Embedded Linux Conference Europe 2013 Hybrid OS vs. Single OS approach  Hybrid OS  More than one OS runs on same hardware  RT specific tasks run on RTOS (Real-Time Operating System) and the other tasks runs on GPOS (General Purpose Operating System)  ex. Linux and uITRON  Possible implementations  By VMM  Run GPOS as a task on RTOS  RTOS and GPOS have different APIs  Xenomai  Single OS  Just use one OS to run both RT and GP applications  Same API can be used for all applications  Possible implementations  Kernel level RT process  RT-Preempt patch
  • 14. 16Embedded Linux Conference Europe 2013 Actual requirement (3): Linux  Linux runs both RT and GP applications CPU Devices Linux Real time process General purpose processes
  • 15. 17Embedded Linux Conference Europe 2013 Summary of requirements 1. Run RT processes and GP processes on a hardware platform 2. Need to meet required deadlines  One of the most important perspective for embedded systems 3. Use single OS approach  Linux
  • 16. 18Embedded Linux Conference Europe 2013 Actual requirement (3): Linux  Linux runs both RT and GP applications  This is not a good idea if you don’t care anything CPU Devices Linux Real time process General purpose processes
  • 17. 19Embedded Linux Conference Europe 2013 Issues to run RT process and GP process  Determinism  RT process should have a deterministic behavior  GP process doesn’t assume deterministic behaviour
  • 18. 20Embedded Linux Conference Europe 2013  Real-time Preemption Patch  Fully preemptive kernel  Improvement for latency  CPU affinity  Prohibit process migration from one core to another  Protect from GP process behaviour  Maybe good for determinism How to improve real time performance? RT CPU core GP CPU core RT thread RTタスクGP thread GP thread Scheduler Scheduler RT thread RT thread Effects by workload
  • 19. 21Embedded Linux Conference Europe 2013  Partition is a set of hardware resource  CPU cores, Memory, Devices, ..  Each partition must be isolated from the others  No device sharing Definition of hardware resource partitioning CPU Devices Linux kernel Real time processes General purpose processes
  • 20. 22Embedded Linux Conference Europe 2013 A use case of CPU affinity for RT process  Run a set of process and thread on specific CPU core Advantage  No process migration  Process migration is not friendly with real time behviour  Migration timing cannot be expected  Just RT process runs on specific cores  Isolate all GP process into the other cores CPU core 1 CPU core 2 RT process
  • 21. 23Embedded Linux Conference Europe 2013 0 20 40 60 80 100 120 140 160 180 200 0 20 40 60 80 100120140160180200220240260280300320340360380400420440460480 Numberofsamples 0 10 20 30 40 50 60 70 80 90 100 0 20 40 60 80 100120140160180200220240260280300320340360380400420440460480 NumberofsamplesEvaluation of interrupt latency with CPU affinity  Evaluation environment  Hardware: Pandaboard  Period: 300μs Interrupt letency [us] CPU Affinity W/O CPU Affinity
  • 22. 24Embedded Linux Conference Europe 2013 0 20 40 60 80 100 120 140 160 180 200 0 20 40 60 80 100120140160180200220240260280300320340360380400420440460480 Numberofsamples 0 10 20 30 40 50 60 70 80 90 100 0 20 40 60 80 100120140160180200220240260280300320340360380400420440460480 NumberofsamplesEvaluation of interrupt latency with CPU affinity 0 10 20 30 40 50 60 70 80 90 100 0 100 200 300 400 500 600 700 800 900 Numberofsamples CPU Affinity (in some case) CPU Affinity W/O CPU Affinity
  • 23. 25Embedded Linux Conference Europe 2013 Period ? What’s occurred? Timer cascade occurs here
  • 24. 26Embedded Linux Conference Europe 2013 CPU core 0 Process CPU core specific kernel thread CPU core 1 Kernel thread Process Kernel thread CPU core specific kernel thread Limitation of CPU affinity  Example for CPU core specific kernel thread  Timer, High resolution timer  Process migration  Etc..
  • 25. 27Embedded Linux Conference Europe 2013 List 1 List 2 List 3 List 4 List 5 Inside the each entry Timer 1 Timer 2 ・・・ cascade() Cascade timer list  Cascade timer  Register the next timer list to the end of current one  Impact of cascade timer to interrupt latency  Runs with interrupt disabled context  No limits for the number of timers  Timer process cost becomes higher when tickless kernel used
  • 26. 28Embedded Linux Conference Europe 2013 Control cascade timers on RT CPU core  Solution  Keep the timer list empty on RT core to protect from cascade timers RT CPU core timer.c GP CPU core Timer timer.c Timer Timer list (Empty) Timer list Kernel thread
  • 27. 29Embedded Linux Conference Europe 2013 RT CPU core Kernel thread __run_timers() GP CPU core timer __run_timers() Kernel thread Timer list Timer list Core specific kernel thread Timer Timer (Ⅲ) (Ⅱ) (Ⅰ) Three issues which cause cascade timers (Ⅰ) Registered by GP process before migration (Ⅱ) Registered by RT Core specific kernel thread (Ⅲ) Registered by RT Core specific kernel thread before RT task runs Expired timers causes cascade
  • 28. 30Embedded Linux Conference Europe 2013 RT core Kernel thread timer.c GP core Timer timer.c Timer Kernel thread Timer list Timer list (イ) (A) (B) Solution for the issue (Ⅰ)  Preparation  Log all timer registration by kernel thread  Solution (A) Migrate kernel threads or a GP processes to GP core (B) Migrate registered times to GP core refer the log (Timer migration)
  • 29. 31Embedded Linux Conference Europe 2013 RT core timer.c GP core タイマ処理 Timer list Timer list Core specific kernel thread Timer Timer (Ⅱ) (Ⅲ) Solution for the issues (Ⅱ) and (Ⅲ) Restrict to resister new timers to the GP core only Case 1: Not enough time to migrate Wait for expiration Case 2: Enough time to migrate Migrate the timer to GP core (Ⅱ) Registered by RT Core specific kernel thread (Ⅲ) Registered by RT Core specific kernel thread before RT task runs
  • 30. 32Embedded Linux Conference Europe 2013 ① ② Evaluation ① ② Cascade occurs here Before After
  • 31. 33Embedded Linux Conference Europe 2013 Summary  Requirement  RT processes and GP processes on a same hardware platform  Just use Linux for both processes  Meet its required deadline for RT process  Hardware resource partitioning  Set of hardware resources which is isolated from the others  Define CPU cores as RT core and GP core  Issues to implement the resource partitioning  Some kernel thread cannot be migrated  Core specific kernel thread  Need to care with CPU affinity feature  Focused on cascade in timer.c  Protect from cascade function on RT core  Keep timer list empty  Future plan  Fixing issues  SCHED_DEADLINE on RT core with fine granularity support
  • 32. 34 Questions? The latest slide is available at the following URL: http://elinux.org/ELC_Europe_2013_Presentations