SlideShare una empresa de Scribd logo
1 de 31
Descargar para leer sin conexión
Presented by
Date
Event
Sched idle
Next irq event predictionDaniel Lezcano
BKK16-203 March 8, 2016
Linaro Connect BKK16
Introduction
● Idle mechanism
● Limitations
● New approach
Introduction
● Idle does not work if the break even is not
reached
○ Consumes more energy
○ Worst performance
● Target residency is the break even
○ https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/ComputingTargetResidency
● Idle duration prediction is the key
The idle process
● No task for each
sched class
● Default task is the
idle task
The idle task
● Two infinite loops
○ One to ensure idle routine is called next time
○ One to handle wakeup + idle
● Yield to another task if any
○ As soon as there is a task to be run, the idle task is
switched
● Enters / exit the idle routine
○ Idle time measurements
Current approach
● When a CPU wakes up from an idle state
○ idle time measurement
● When a CPU goes idle
○ statistics on idle time
○ Reuse statistics to guess estimate the idle duration
Current approach
● What woke up the CPU ?
○ a timer ? an IO device ? an IPI ?
■ https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/WakeUpSources
● It is not possible to know. It results to:
○ statistics on timers but they are deterministic
○ statistics on IPI, thus on the scheduler behavior
Current approach
● This wake up sources soup leads to some
complex re-adjustments in the statistics
○ empiric
○ platform specific (x86)
○ monolithic
● It is hard to tell if the prediction was correct
Current approach
● Prediction and governor are tied
○ CPUidle is a standalone subsystem
○ No interaction with the scheduler
● Scheduler can’t use the prediction value to
anticipate anything
○ Hard to integrate the power subsystems
What do we want ?
● The scheduler to act:
○ as a governor
○ pro actively
○ with knowledge of future events
What do we need ?
● Split prediction and idle state selection
● Increase the prediction accuracy
● Let the scheduler to have access to the
prediction
How do we do that ?
● Track the interrupts independently
○ measure their intervals
○ apply a simple mathematical formula for their
behavior
○ guess estimate the next event per interrupt
● Timers and IPI are out of the equation
● Full view of what is happening on the system
Analysis
● A network trafic + console output
○ kernelshark trace-net.dat
● A SSD random read
○ kernelshark trace-ssd.dat
Analysis - SSD
Analysis - SSD
● Beginning of the measurement => writing a
big file
● Rest of the measurement => random read
● Write is hard to predict
● Read is stable
Analysis - Network
Analysis - Network
● Intervals are stable
● Repeating patterns
○ Four values
○ Looks like gaussian => normal law ?
Analysis - Serial console
Analysis - serial
● Very stable interrupt
● Repeating pattern easily predictable
○ ~1ms x 5 + ~210ms
Analysis
Interrupt A Interrupt B
Sampling
Next event Interrupt A
Next event Interrupt BMin
Next event is coming
from interrupt A
Analysis - Conclusion
● With a correct prediction for each interrupt
○ increase of the accuracy for the next event
● Mixing all interrupts, we can choose the
earliest one
Analysis - Conclusion
● Risk ?
○ Cumulative error on each irq prediction
○ Mathematical model vs performance in kernel
○ Different behavior for each irq
● Challenge ?
○ Solve the above
○ Find the right mathematical model
● Approach ?
○ Incremental
IRQ based next event status
● Submitted upstream as RFC
○ https://lwn.net/Articles/670505/
● Positive feedbacks and article in LWN
○ https://lwn.net/Articles/673641/
Scheduler + idle
● Peter Ziljstra :
○ “I think the scheduler simply wants to say: we expect
to go idle for X ns, we want a guaranteed wakeup
latency of Y ns -- go do your thing.”
○ https://lkml.org/lkml/2013/11/11/353“
Scheduler + idle
● Two new APIs:
○ s64 sched_idle_next_wakeup(void);
■ “[ … ] we expect to go idle for X ns [ … ]”
○ int sched_idle(s64 duration, unsigned int latency);
■ “[ …] go do your thing [ …]”
○ (Latency API is already there)
Scheduler + idle
● From the scheduler, the information ...
○ When a CPU will wake up ?
○ How long a CPU will be idle ?
● … are now available
● The scheduler has the information to take a
decision regarding the energy saving
○ the scheduler will be able to act as a governor
Scheduler + idle
● Task rebalancing
○ scheduler knows if it is worth to migrate a task
■ eg. is the target CPU about to wake up ?
● Scheduler can force latencies
Scheduler + idle
● Topology and idle information
○ Compute target residency at different level:
■ Cpu
■ Cluster
■ “SoC”
○ Predicted idle time is the time intersection between
components
■ Eg. idle(cluster0) = idle(cpu0) ∩ idle(cpu1)
Some results
● Simple approach but better results in some
cases
● SMP is much better but UP worst
Some results
Next steps
● Instrumentation
● Improve the model
○ Bayesian network (TBS)
● Upstream the first bits
○ Approach is accepted
● Enlarge community (very important)
○ More testing and validation
● Scheduler tuning

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

OVN DBs HA with scale test
OVN DBs HA with scale testOVN DBs HA with scale test
OVN DBs HA with scale test
 
BKK16-300 Benchmarking 102
BKK16-300 Benchmarking 102BKK16-300 Benchmarking 102
BKK16-300 Benchmarking 102
 
BUD17-300: Journey of a packet
BUD17-300: Journey of a packetBUD17-300: Journey of a packet
BUD17-300: Journey of a packet
 
BKK16-410 SoC Idling & CPU Cluster PM
BKK16-410 SoC Idling & CPU Cluster PMBKK16-410 SoC Idling & CPU Cluster PM
BKK16-410 SoC Idling & CPU Cluster PM
 
Large scale overlay networks with ovn: problems and solutions
Large scale overlay networks with ovn: problems and solutionsLarge scale overlay networks with ovn: problems and solutions
Large scale overlay networks with ovn: problems and solutions
 
MazuV-Debug-System
MazuV-Debug-SystemMazuV-Debug-System
MazuV-Debug-System
 
OVN operationalization at scale at eBay
OVN operationalization at scale at eBayOVN operationalization at scale at eBay
OVN operationalization at scale at eBay
 
LAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoS
 
LAS16-211: Using LAVA V2 for advanced KVM testing
LAS16-211: Using LAVA V2 for advanced KVM testingLAS16-211: Using LAVA V2 for advanced KVM testing
LAS16-211: Using LAVA V2 for advanced KVM testing
 
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandAsymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
 
BKK16-502 Suspend to Idle
BKK16-502 Suspend to IdleBKK16-502 Suspend to Idle
BKK16-502 Suspend to Idle
 
BKK16-209 Chromium with V4L2 playback - is it ready today?
BKK16-209 Chromium with V4L2 playback - is it ready today?BKK16-209 Chromium with V4L2 playback - is it ready today?
BKK16-209 Chromium with V4L2 playback - is it ready today?
 
LAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVALAS16-507: LXC support in LAVA
LAS16-507: LXC support in LAVA
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7
 
BUD17-214: Bus scaling QoS update
BUD17-214: Bus scaling QoS update BUD17-214: Bus scaling QoS update
BUD17-214: Bus scaling QoS update
 
LAS16-101: Efficient kernel backporting
LAS16-101: Efficient kernel backportingLAS16-101: Efficient kernel backporting
LAS16-101: Efficient kernel backporting
 
LAS16-TR02: Upstreaming 101
LAS16-TR02: Upstreaming 101LAS16-TR02: Upstreaming 101
LAS16-TR02: Upstreaming 101
 
Keeping Latency Low and Throughput High with Application-level Priority Manag...
Keeping Latency Low and Throughput High with Application-level Priority Manag...Keeping Latency Low and Throughput High with Application-level Priority Manag...
Keeping Latency Low and Throughput High with Application-level Priority Manag...
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack Update
 
HKG15-301: OVS implemented via ODP & vendor SDKs
HKG15-301: OVS implemented via ODP & vendor SDKsHKG15-301: OVS implemented via ODP & vendor SDKs
HKG15-301: OVS implemented via ODP & vendor SDKs
 

Similar a BKK16-203 Irq prediction or how to better estimate idle time

BUD17-309: IRQ prediction
BUD17-309: IRQ prediction BUD17-309: IRQ prediction
BUD17-309: IRQ prediction
Linaro
 
Making Sites Reliable (как сделать систему надежной) (Павел Уваров, Андрей Та...
Making Sites Reliable (как сделать систему надежной) (Павел Уваров, Андрей Та...Making Sites Reliable (как сделать систему надежной) (Павел Уваров, Андрей Та...
Making Sites Reliable (как сделать систему надежной) (Павел Уваров, Андрей Та...
Ontico
 

Similar a BKK16-203 Irq prediction or how to better estimate idle time (20)

BUD17-309: IRQ prediction
BUD17-309: IRQ prediction BUD17-309: IRQ prediction
BUD17-309: IRQ prediction
 
Piano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processingPiano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processing
 
OpenSearch.pdf
OpenSearch.pdfOpenSearch.pdf
OpenSearch.pdf
 
Server fleet management using Camunda by Akhil Ahuja
Server fleet management using Camunda by Akhil AhujaServer fleet management using Camunda by Akhil Ahuja
Server fleet management using Camunda by Akhil Ahuja
 
Distributed implementation of a lstm on spark and tensorflow
Distributed implementation of a lstm on spark and tensorflowDistributed implementation of a lstm on spark and tensorflow
Distributed implementation of a lstm on spark and tensorflow
 
Activity feeds (and more) at mate1
Activity feeds (and more) at mate1Activity feeds (and more) at mate1
Activity feeds (and more) at mate1
 
Tapjoy OpenStack Summit Paris Breakout Session
Tapjoy OpenStack Summit Paris Breakout SessionTapjoy OpenStack Summit Paris Breakout Session
Tapjoy OpenStack Summit Paris Breakout Session
 
Mirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in GoMirko Damiani - An Embedded soft real time distributed system in Go
Mirko Damiani - An Embedded soft real time distributed system in Go
 
Making Sites Reliable (как сделать систему надежной) (Павел Уваров, Андрей Та...
Making Sites Reliable (как сделать систему надежной) (Павел Уваров, Андрей Та...Making Sites Reliable (как сделать систему надежной) (Павел Уваров, Андрей Та...
Making Sites Reliable (как сделать систему надежной) (Павел Уваров, Андрей Та...
 
Reading: "Pi in the sky: Calculating a record-breaking 31.4 trillion digits o...
Reading: "Pi in the sky: Calculating a record-breaking 31.4 trillion digits o...Reading: "Pi in the sky: Calculating a record-breaking 31.4 trillion digits o...
Reading: "Pi in the sky: Calculating a record-breaking 31.4 trillion digits o...
 
Monitoring Big Data Systems - "The Simple Way"
Monitoring Big Data Systems - "The Simple Way"Monitoring Big Data Systems - "The Simple Way"
Monitoring Big Data Systems - "The Simple Way"
 
Streamsets and spark in Retail
Streamsets and spark in RetailStreamsets and spark in Retail
Streamsets and spark in Retail
 
Analytic Insights in Retail Using Apache Spark with Hari Shreedharan
Analytic Insights in Retail Using Apache Spark with Hari ShreedharanAnalytic Insights in Retail Using Apache Spark with Hari Shreedharan
Analytic Insights in Retail Using Apache Spark with Hari Shreedharan
 
uReplicator: Uber Engineering’s Scalable, Robust Kafka Replicator
uReplicator: Uber Engineering’s Scalable,  Robust Kafka ReplicatoruReplicator: Uber Engineering’s Scalable,  Robust Kafka Replicator
uReplicator: Uber Engineering’s Scalable, Robust Kafka Replicator
 
Log Management: AtlSecCon2015
Log Management: AtlSecCon2015Log Management: AtlSecCon2015
Log Management: AtlSecCon2015
 
Untangling the Intricacies of Thread Synchronization in the PREEMPT_RT Linux ...
Untangling the Intricacies of Thread Synchronization in the PREEMPT_RT Linux ...Untangling the Intricacies of Thread Synchronization in the PREEMPT_RT Linux ...
Untangling the Intricacies of Thread Synchronization in the PREEMPT_RT Linux ...
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
AWS Techniques and lessons writing low cost autoscaling GitLab runners
AWS Techniques and lessons writing low cost autoscaling GitLab runnersAWS Techniques and lessons writing low cost autoscaling GitLab runners
AWS Techniques and lessons writing low cost autoscaling GitLab runners
 
Kernel Recipes 2014 - Performance Does Matter
Kernel Recipes 2014 - Performance Does MatterKernel Recipes 2014 - Performance Does Matter
Kernel Recipes 2014 - Performance Does Matter
 
Optimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdfOptimizing Scheduler for Linux Gaming.pdf
Optimizing Scheduler for Linux Gaming.pdf
 

Más de Linaro

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Linaro
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
Linaro
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Linaro
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
Linaro
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
Linaro
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
Linaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
Linaro
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
Linaro
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
Linaro
 

Más de Linaro (20)

Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea GalloDeep Learning Neural Network Acceleration at the Edge - Andrea Gallo
Deep Learning Neural Network Acceleration at the Edge - Andrea Gallo
 
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta VekariaArm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
Arm Architecture HPC Workshop Santa Clara 2018 - Kanta Vekaria
 
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua MoraHuawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
Huawei’s requirements for the ARM based HPC solution readiness - Joshua Mora
 
Bud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qaBud17 113: distribution ci using qemu and open qa
Bud17 113: distribution ci using qemu and open qa
 
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
OpenHPC Automation with Ansible - Renato Golin - Linaro Arm HPC Workshop 2018
 
HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018
 
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
It just keeps getting better - SUSE enablement for Arm - Linaro HPC Workshop ...
 
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
Intelligent Interconnect Architecture to Enable Next Generation HPC - Linaro ...
 
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
Yutaka Ishikawa - Post-K and Arm HPC Ecosystem - Linaro Arm HPC Workshop Sant...
 
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
Andrew J Younge - Vanguard Astra - Petascale Arm Platform for U.S. DOE/ASC Su...
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening Keynote
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP Workshop
 
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainlineHKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
HKG18-501 - EAS on Common Kernel 4.14 and getting (much) closer to mainline
 
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and allHKG18-315 - Why the ecosystem is a wonderful thing, warts and all
HKG18-315 - Why the ecosystem is a wonderful thing, warts and all
 
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse HypervisorHKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
HKG18- 115 - Partitioning ARM Systems with the Jailhouse Hypervisor
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMU
 
HKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8MHKG18-113- Secure Data Path work with i.MX8M
HKG18-113- Secure Data Path work with i.MX8M
 
HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation HKG18-120 - Devicetree Schema Documentation and Validation
HKG18-120 - Devicetree Schema Documentation and Validation
 
HKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted bootHKG18-223 - Trusted FirmwareM: Trusted boot
HKG18-223 - Trusted FirmwareM: Trusted boot
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

BKK16-203 Irq prediction or how to better estimate idle time

  • 1. Presented by Date Event Sched idle Next irq event predictionDaniel Lezcano BKK16-203 March 8, 2016 Linaro Connect BKK16
  • 2. Introduction ● Idle mechanism ● Limitations ● New approach
  • 3. Introduction ● Idle does not work if the break even is not reached ○ Consumes more energy ○ Worst performance ● Target residency is the break even ○ https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/ComputingTargetResidency ● Idle duration prediction is the key
  • 4. The idle process ● No task for each sched class ● Default task is the idle task
  • 5. The idle task ● Two infinite loops ○ One to ensure idle routine is called next time ○ One to handle wakeup + idle ● Yield to another task if any ○ As soon as there is a task to be run, the idle task is switched ● Enters / exit the idle routine ○ Idle time measurements
  • 6. Current approach ● When a CPU wakes up from an idle state ○ idle time measurement ● When a CPU goes idle ○ statistics on idle time ○ Reuse statistics to guess estimate the idle duration
  • 7. Current approach ● What woke up the CPU ? ○ a timer ? an IO device ? an IPI ? ■ https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/WakeUpSources ● It is not possible to know. It results to: ○ statistics on timers but they are deterministic ○ statistics on IPI, thus on the scheduler behavior
  • 8. Current approach ● This wake up sources soup leads to some complex re-adjustments in the statistics ○ empiric ○ platform specific (x86) ○ monolithic ● It is hard to tell if the prediction was correct
  • 9. Current approach ● Prediction and governor are tied ○ CPUidle is a standalone subsystem ○ No interaction with the scheduler ● Scheduler can’t use the prediction value to anticipate anything ○ Hard to integrate the power subsystems
  • 10. What do we want ? ● The scheduler to act: ○ as a governor ○ pro actively ○ with knowledge of future events
  • 11. What do we need ? ● Split prediction and idle state selection ● Increase the prediction accuracy ● Let the scheduler to have access to the prediction
  • 12. How do we do that ? ● Track the interrupts independently ○ measure their intervals ○ apply a simple mathematical formula for their behavior ○ guess estimate the next event per interrupt ● Timers and IPI are out of the equation ● Full view of what is happening on the system
  • 13. Analysis ● A network trafic + console output ○ kernelshark trace-net.dat ● A SSD random read ○ kernelshark trace-ssd.dat
  • 15. Analysis - SSD ● Beginning of the measurement => writing a big file ● Rest of the measurement => random read ● Write is hard to predict ● Read is stable
  • 17. Analysis - Network ● Intervals are stable ● Repeating patterns ○ Four values ○ Looks like gaussian => normal law ?
  • 18. Analysis - Serial console
  • 19. Analysis - serial ● Very stable interrupt ● Repeating pattern easily predictable ○ ~1ms x 5 + ~210ms
  • 20. Analysis Interrupt A Interrupt B Sampling Next event Interrupt A Next event Interrupt BMin Next event is coming from interrupt A
  • 21. Analysis - Conclusion ● With a correct prediction for each interrupt ○ increase of the accuracy for the next event ● Mixing all interrupts, we can choose the earliest one
  • 22. Analysis - Conclusion ● Risk ? ○ Cumulative error on each irq prediction ○ Mathematical model vs performance in kernel ○ Different behavior for each irq ● Challenge ? ○ Solve the above ○ Find the right mathematical model ● Approach ? ○ Incremental
  • 23. IRQ based next event status ● Submitted upstream as RFC ○ https://lwn.net/Articles/670505/ ● Positive feedbacks and article in LWN ○ https://lwn.net/Articles/673641/
  • 24. Scheduler + idle ● Peter Ziljstra : ○ “I think the scheduler simply wants to say: we expect to go idle for X ns, we want a guaranteed wakeup latency of Y ns -- go do your thing.” ○ https://lkml.org/lkml/2013/11/11/353“
  • 25. Scheduler + idle ● Two new APIs: ○ s64 sched_idle_next_wakeup(void); ■ “[ … ] we expect to go idle for X ns [ … ]” ○ int sched_idle(s64 duration, unsigned int latency); ■ “[ …] go do your thing [ …]” ○ (Latency API is already there)
  • 26. Scheduler + idle ● From the scheduler, the information ... ○ When a CPU will wake up ? ○ How long a CPU will be idle ? ● … are now available ● The scheduler has the information to take a decision regarding the energy saving ○ the scheduler will be able to act as a governor
  • 27. Scheduler + idle ● Task rebalancing ○ scheduler knows if it is worth to migrate a task ■ eg. is the target CPU about to wake up ? ● Scheduler can force latencies
  • 28. Scheduler + idle ● Topology and idle information ○ Compute target residency at different level: ■ Cpu ■ Cluster ■ “SoC” ○ Predicted idle time is the time intersection between components ■ Eg. idle(cluster0) = idle(cpu0) ∩ idle(cpu1)
  • 29. Some results ● Simple approach but better results in some cases ● SMP is much better but UP worst
  • 31. Next steps ● Instrumentation ● Improve the model ○ Bayesian network (TBS) ● Upstream the first bits ○ Approach is accepted ● Enlarge community (very important) ○ More testing and validation ● Scheduler tuning