SlideShare a Scribd company logo
1 of 36
Download to read offline
More about Linaro Connect: connect.linaro.org
More about Linaro: www.linaro.org/about/
More about Linaro engineering: www.linaro.org/engineering/
Hong-Kong (LCE13)
2
EUROPE 2012 (LCE12)
www.linaro.org
Linaro Connect Hong-Kong 2013
Who disturbs my
slumber ?!
3
EUROPE 2012 (LCE12)
www.linaro.org
Introduction
The power management is a wide area
Power aware scheduler, P-States, C-States, optimizations for idling the
cpu, regulators ...
We will focus on the sources of wake up for ARM architecture
4
EUROPE 2012 (LCE12)
www.linaro.org
PM diagram blocks
5
EUROPE 2012 (LCE12)
www.linaro.org
Introduction
“Idle” opposite to “Running”, in between an event occurs.
We want a cpu to be idle as much as possible without
impacting the performance of the system
The cpuidle framework takes care of entering the idle state depending
on the predictable events on the system
The depth of the sleep will depend on the next event on the system
What is this event ? An interrupt.
6
EUROPE 2012 (LCE12)
www.linaro.org
Idle vs Running
When there is no more tasks to run, the scheduler choose
the special idle task
This one is an infinite loop entering and exiting the arch
specific idle function
When an interrupt occurs, the function exits and the idle
task is yield or enters again into the idle function
7
EUROPE 2012 (LCE12)
www.linaro.org
Idle vs Running – UP
8
EUROPE 2012 (LCE12)
www.linaro.org
Idle vs Running – SMP
9
EUROPE 2012 (LCE12)
www.linaro.org
Package Idle
The deep idle state could be reached only when all cpus are
idle
One cpu exiting the idle state will lead the package to exit
the idle state also
Software idle states management is challenging on
multicore SoCs
10
EUROPE 2012 (LCE12)
www.linaro.org
Package idle
11
EUROPE 2012 (LCE12)
www.linaro.org
/proc/interrupts – Snowball U8500
CPU0 CPU1
29: 3150 4124 GIC twd
36: 783 0 GIC Nomadik Timer Tick
...
57: 1592 0 GIC dma40
58: 73 0 GIC uart-pl011
72: 0 0 GIC ab8500
79: 187 0 GIC prcmu
87: 0 0 GIC nmk-i2c
92: 4687 0 GIC mmci-pl18x (cmd)
131: 14897 0 GIC mmci-pl18x (cmd)
...
IPI0: 0 0 CPU wakeup interrupts
IPI1: 0 167 Timer broadcast interrupts
IPI2: 386 4908 Rescheduling interrupts
IPI3: 0 0 Function call interrupts
IPI4: 3 67 Single function call interrupts
IPI5: 0 0 CPU stop interrupts
Err: 0
12
EUROPE 2012 (LCE12)
www.linaro.org
/proc/interrupts – Pandaboard OMAP4
CPU0 CPU1
29: 293 395 GIC twd
41: 0 0 GIC l3-dbg-irq
42: 0 0 GIC l3-app-irq
44: 0 0 GIC DMA
69: 61 0 GIC gp_timer
88: 0 0 GIC i2c.9
89: 0 0 GIC i2c.10
93: 0 0 GIC i2c.11
94: 0 0 GIC i2c.12
106: 93 0 GIC OMAP UART2
169: 0 0 PRCM hwmod_io
IPI0: 0 0 Timer broadcast interrupts
IPI1: 1424 1260 Rescheduling interrupts
IPI2: 0 0 Function call interrupts
IPI3: 81 90 Single function call interrupts
IPI4: 0 0 CPU stop interrupts
Err: 0
13
EUROPE 2012 (LCE12)
www.linaro.org
Challenging the interrupts
Where are they coming from ?
When do they occur ?
How can we reduce them ?
14
EUROPE 2012 (LCE12)
www.linaro.org
From where ?
Hardware interrupt
Network, keyboard, mouse, timer, MMC, USB, serial, ...
Inter Processor Interrupt : Wisely used today, they are tricky
to optimize
The architecture differs across the SoC vendor but they are
slightly similar for the IPI
15
EUROPE 2012 (LCE12)
www.linaro.org
Hardware interrupt
HW interrupt can happen at arbitrary times
The system could be tweaked depending on the hardware
One deterministic interrupt is interesting : the timer
16
EUROPE 2012 (LCE12)
www.linaro.org
Hardware interrupt
Interrupt Deterministic Comment
Network No The network stack switch
to polling on high traffic
Keyboard No
Mouse No
MMC No
Timer Yes Two kinds of timer
USB No
Serial No
17
EUROPE 2012 (LCE12)
www.linaro.org
Timers
A complex infrastructure to handle most of the kernel and
time services for userspace programs
Two kinds of timer
Per cpu timer
Global timer
18
EUROPE 2012 (LCE12)
www.linaro.org
Timers
Timer Watchdog (twd)
The timer is local to the CPU
Also known as “local timer”
It goes down when the processor logic is shutdown
Timer device (architecture dependant)
Less accurate (eg. 32KHz)
Usually always out of the CPU’s power domain
Used as backup when the CPU are sleeping
19
EUROPE 2012 (LCE12)
www.linaro.org
Timers
Used by the kernel for:
Network stack, especially the TCP/IP protocol
Timed-out IO
Delayed work queues
Scheduling tasks
...
Used by the userspace for:
Asynchronous IO and timeout
Threading timed lock
Mainloop (poll, epoll, select)
Posix timers
...
In other words : widely used in the system
20
EUROPE 2012 (LCE12)
www.linaro.org
IPI : Inter Processor Interrupt
A softirq
Limited to 16 on ARM with the GIC
5 used nowadays
IPI0 : defined but unused so far
IPI1 : timer broadcast
IPI2 : Rescheduling interrupt
IPI3 : Function Call interrupt
IPI4 : Single Function Call interrupt
IPI5 : Cpu Stop interrupt
21
EUROPE 2012 (LCE12)
www.linaro.org
IPI1 : Timer broadcast (1/3)
Occurs only if SMP and cpuidle with at least retention mode
state
Broadcast interrupt could occur on any cpu:
idle or not
concerned by the timer expiration or not
Could be optimized with dynamic timer irq affinity
https://lkml.org/lkml/2013/2/19/555
A summary of how timer broadcast works
https://lkml.org/lkml/2013/2/20/216
22
EUROPE 2012 (LCE12)
www.linaro.org
IPI1 : Timer broadcast (2/3)
[1] : the cpuidle driver tells the time
framework the local timer is no
longer a valid source
[2] : the timer framework changes
the source and program the timer
device
[3] / [3'] : the cpuidle driver power
downs the cpus
23
EUROPE 2012 (LCE12)
www.linaro.org
IPI1 : Timer broadcast (3/3)
[1] : the timer expires raising an
interrupt
[2] : the cpu is woken up
[3] : the cpu handles the timer
callback and through the time
framework …
[4] … it sends an IPI to the cpu
which are concerned by the
expiration of this timer
24
EUROPE 2012 (LCE12)
www.linaro.org
IPI2 : Rescheduling interrupt (1/4)
Used by the scheduler to wake up a processor in order to
run a task
Could happen for different reasons:
Load balancing / process migration
An event occurs for a specific task
IO (eg. network ingress packet)
A lock has been released for a blocked task
Signal delivery
25
EUROPE 2012 (LCE12)
www.linaro.org
IPI2 : Rescheduling interrupt (2/4)
CPU0 is running an application
CPU1 is idle
A task on CPU1 is blocked on a lock
26
EUROPE 2012 (LCE12)
www.linaro.org
IPI2 : Rescheduling interrupt (3/4)
The application on CPU0 releases
the lock
The scheduler takes the decision to
wake up the CPU1...
… and send an IPI to it
27
EUROPE 2012 (LCE12)
www.linaro.org
IPI2 : Rescheduling interrupt (4/4)
The CPU1 is awake
The scheduler put in the run queue
the task which was previously
blocked
28
EUROPE 2012 (LCE12)
www.linaro.org
IPI3 : Function Call interrupt
Used to do a remote function invocation on all the CPUs
when the code must be run in the processor context
Setting the timer frequency
Setting up the clock event notify framework
It happens rarely on the ARM system, but often on x86
system under the term of “TLB shootdowns” which happens
at fork time
29
EUROPE 2012 (LCE12)
www.linaro.org
IPI3 : Function Call interrupt
Used to do a remote function invocation on all the CPUs
when the code must be run in the processor context
Setting the timer frequency
Setting up the clock event notify framework
It happens rarely on the ARM system, but often on x86
system under the term of “TLB shootdowns” which happens
at fork time
30
EUROPE 2012 (LCE12)
www.linaro.org
IPI4 : Single Function Call interrupt
Same as the IPI3 but for a targeted CPU
Happens rarely on the system
31
EUROPE 2012 (LCE12)
www.linaro.org
How to reduce the number of interrupts ?
Understand the framework and identify the unnecessary wake up
Deferrable timers
http://lwn.net/Articles/228143/
Round jiffies
http://lkml.org/lkml/2006/10/10/189
RCU no callback
http://lwn.net/Articles/522262
Timer and workqueue migration on non idle cpu
https://lkml.org/lkml/2012/9/27/188
32
EUROPE 2012 (LCE12)
www.linaro.org
Deferrable timers
Used for non critical timers and change their expiration to
occur when the CPU wakes up
How to use it ?
Identify non critical timers
Flag them deferrable
They will be handled when the CPU wakes up for another reason
33
EUROPE 2012 (LCE12)
www.linaro.org
Round jiffies
Used to group timers to expire at the same time slot
How to use it ?
Identify timers for non precise timeout
Group them to the same time slot by using round_jiffies
34
EUROPE 2012 (LCE12)
www.linaro.org
Timer and workqueue migration
Schedule work onto running CPUs instead of waking up an
idle one
Still work in progress
35
EUROPE 2012 (LCE12)
www.linaro.org
Misc improvements
The kernel does not do everything, userspace applications
have to be improved for power management
The application could group the timers to expire at the same
time if high precision is not needed
Round-jiffies like framework ?
A specific flag for timer syscalls, in order to make them deferrable ?
prctl : PR_SET_TIMERSLACK
36
EUROPE 2012 (LCE12)
www.linaro.org
Misc improvements
Kill all busyloop and replace them with an event based
mainloop
timerfd, signalfd, eventfd, etc …
Increase MTU size for private network area when possible
Use CPU affinity when multiple tasks have to run to
sequentially
Put pressure on developers to fix the applications and make
them more power aware, the kernel can not overcome bad
applications

More Related Content

What's hot

Power management
Power managementPower management
Power managementScott Shu
 
The Theory and Implementation of DVFS on Linux
The Theory and Implementation of DVFS on LinuxThe Theory and Implementation of DVFS on Linux
The Theory and Implementation of DVFS on LinuxPicker Weng
 
BKK16-317 How to generate power models for EAS and IPA
BKK16-317 How to generate power models for EAS and IPABKK16-317 How to generate power models for EAS and IPA
BKK16-317 How to generate power models for EAS and IPALinaro
 
BKK16-208 EAS
BKK16-208 EASBKK16-208 EAS
BKK16-208 EASLinaro
 
Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29Varun Mahajan
 
Power Management in Embedded Systems
Power Management in Embedded Systems Power Management in Embedded Systems
Power Management in Embedded Systems mentoresd
 
LAS16-105: Walkthrough of the EAS kernel adaptation to the Android Common Kernel
LAS16-105: Walkthrough of the EAS kernel adaptation to the Android Common KernelLAS16-105: Walkthrough of the EAS kernel adaptation to the Android Common Kernel
LAS16-105: Walkthrough of the EAS kernel adaptation to the Android Common KernelLinaro
 
Block I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBlock I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBabak Farrokhi
 
Cyclone III FPGA Overview Part2
Cyclone III FPGA Overview Part2Cyclone III FPGA Overview Part2
Cyclone III FPGA Overview Part2Premier Farnell
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringGeorg Schönberger
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at ScaleAntony Messerl
 
PowerDRC/LVS 2.0.1 released by POLYTEDA
PowerDRC/LVS 2.0.1 released by POLYTEDAPowerDRC/LVS 2.0.1 released by POLYTEDA
PowerDRC/LVS 2.0.1 released by POLYTEDAAlexander Grudanov
 
Microchip NANOWatt Technology
Microchip NANOWatt TechnologyMicrochip NANOWatt Technology
Microchip NANOWatt TechnologyEmanuele Bonanni
 
04 Mcu Day Stellaris 8 12b Editado
04   Mcu Day   Stellaris 8 12b   Editado04   Mcu Day   Stellaris 8 12b   Editado
04 Mcu Day Stellaris 8 12b EditadoTexas Instruments
 
03 Mcu Day 2009 (C2000) 8 13 Editado
03   Mcu Day 2009 (C2000) 8 13   Editado03   Mcu Day 2009 (C2000) 8 13   Editado
03 Mcu Day 2009 (C2000) 8 13 EditadoTexas Instruments
 
Real Time Clock Interfacing with FPGA
Real Time Clock Interfacing with FPGAReal Time Clock Interfacing with FPGA
Real Time Clock Interfacing with FPGAMafaz Ahmed
 

What's hot (20)

Power management
Power managementPower management
Power management
 
The Theory and Implementation of DVFS on Linux
The Theory and Implementation of DVFS on LinuxThe Theory and Implementation of DVFS on Linux
The Theory and Implementation of DVFS on Linux
 
BKK16-317 How to generate power models for EAS and IPA
BKK16-317 How to generate power models for EAS and IPABKK16-317 How to generate power models for EAS and IPA
BKK16-317 How to generate power models for EAS and IPA
 
BKK16-208 EAS
BKK16-208 EASBKK16-208 EAS
BKK16-208 EAS
 
Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29
 
Power Management in Embedded Systems
Power Management in Embedded Systems Power Management in Embedded Systems
Power Management in Embedded Systems
 
LAS16-105: Walkthrough of the EAS kernel adaptation to the Android Common Kernel
LAS16-105: Walkthrough of the EAS kernel adaptation to the Android Common KernelLAS16-105: Walkthrough of the EAS kernel adaptation to the Android Common Kernel
LAS16-105: Walkthrough of the EAS kernel adaptation to the Android Common Kernel
 
OS_Ch2
OS_Ch2OS_Ch2
OS_Ch2
 
Linux Kernel Live Patching
Linux Kernel Live PatchingLinux Kernel Live Patching
Linux Kernel Live Patching
 
Block I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBlock I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktrace
 
Iuwne10 S06 L03
Iuwne10 S06 L03Iuwne10 S06 L03
Iuwne10 S06 L03
 
Cyclone III FPGA Overview Part2
Cyclone III FPGA Overview Part2Cyclone III FPGA Overview Part2
Cyclone III FPGA Overview Part2
 
Linux Performance Profiling and Monitoring
Linux Performance Profiling and MonitoringLinux Performance Profiling and Monitoring
Linux Performance Profiling and Monitoring
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at Scale
 
PowerDRC/LVS 2.0.1 released by POLYTEDA
PowerDRC/LVS 2.0.1 released by POLYTEDAPowerDRC/LVS 2.0.1 released by POLYTEDA
PowerDRC/LVS 2.0.1 released by POLYTEDA
 
Microchip NANOWatt Technology
Microchip NANOWatt TechnologyMicrochip NANOWatt Technology
Microchip NANOWatt Technology
 
04 Mcu Day Stellaris 8 12b Editado
04   Mcu Day   Stellaris 8 12b   Editado04   Mcu Day   Stellaris 8 12b   Editado
04 Mcu Day Stellaris 8 12b Editado
 
03 Mcu Day 2009 (C2000) 8 13 Editado
03   Mcu Day 2009 (C2000) 8 13   Editado03   Mcu Day 2009 (C2000) 8 13   Editado
03 Mcu Day 2009 (C2000) 8 13 Editado
 
Real Time Clock Interfacing with FPGA
Real Time Clock Interfacing with FPGAReal Time Clock Interfacing with FPGA
Real Time Clock Interfacing with FPGA
 
Linux Kernel Debugging
Linux Kernel DebuggingLinux Kernel Debugging
Linux Kernel Debugging
 

Similar to LCA13: Who Disturbs My Slumber

QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation Jiann-Fuh Liaw
 
Nvidia tegra K1 Presentation
Nvidia tegra K1 PresentationNvidia tegra K1 Presentation
Nvidia tegra K1 PresentationANURAG SEKHSARIA
 
An Essential Relationship between Real-time and Resource Partitioning
An Essential Relationship between Real-time and Resource PartitioningAn Essential Relationship between Real-time and Resource Partitioning
An Essential Relationship between Real-time and Resource PartitioningYoshitake Kobayashi
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOSICS
 
AVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerAVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerMohamed Ali
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxMeghdeepSingh
 
SCADA Strangelove: взлом во имя
SCADA Strangelove: взлом во имяSCADA Strangelove: взлом во имя
SCADA Strangelove: взлом во имяEkaterina Melnik
 
SCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the NameSCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the NamePositive Hack Days
 
PIC Introduction and explained in detailed
PIC Introduction and explained in detailedPIC Introduction and explained in detailed
PIC Introduction and explained in detailedAnkita Tiwari
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded Systemrmkceteee
 
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversSatpal Parmar
 
Troubleshooting linux-kernel-modules-and-device-drivers-1233050713693744-1
Troubleshooting linux-kernel-modules-and-device-drivers-1233050713693744-1Troubleshooting linux-kernel-modules-and-device-drivers-1233050713693744-1
Troubleshooting linux-kernel-modules-and-device-drivers-1233050713693744-1Jagadisha Maiya
 
unit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptxunit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptxKandavelEee
 
LCA13: CPUIDLE: One driver to rule them all?
LCA13: CPUIDLE: One driver to rule them all?LCA13: CPUIDLE: One driver to rule them all?
LCA13: CPUIDLE: One driver to rule them all?Linaro
 
An Introduction to the Formalised Memory Model for Linux Kernel
An Introduction to the Formalised Memory Model for Linux KernelAn Introduction to the Formalised Memory Model for Linux Kernel
An Introduction to the Formalised Memory Model for Linux KernelSeongJae Park
 
Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Ramadan Ramadan
 
SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016Koan-Sin Tan
 

Similar to LCA13: Who Disturbs My Slumber (20)

QEMU - Binary Translation
QEMU - Binary Translation QEMU - Binary Translation
QEMU - Binary Translation
 
Nvidia tegra K1 Presentation
Nvidia tegra K1 PresentationNvidia tegra K1 Presentation
Nvidia tegra K1 Presentation
 
My i2c
My i2cMy i2c
My i2c
 
An Essential Relationship between Real-time and Resource Partitioning
An Essential Relationship between Real-time and Resource PartitioningAn Essential Relationship between Real-time and Resource Partitioning
An Essential Relationship between Real-time and Resource Partitioning
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOS
 
AVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerAVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontroller
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
 
SCADA Strangelove: взлом во имя
SCADA Strangelove: взлом во имяSCADA Strangelove: взлом во имя
SCADA Strangelove: взлом во имя
 
SCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the NameSCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the Name
 
PIC Introduction and explained in detailed
PIC Introduction and explained in detailedPIC Introduction and explained in detailed
PIC Introduction and explained in detailed
 
EE6602 Embedded System
EE6602 Embedded SystemEE6602 Embedded System
EE6602 Embedded System
 
Finalppt
FinalpptFinalppt
Finalppt
 
Troubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device DriversTroubleshooting Linux Kernel Modules And Device Drivers
Troubleshooting Linux Kernel Modules And Device Drivers
 
Troubleshooting linux-kernel-modules-and-device-drivers-1233050713693744-1
Troubleshooting linux-kernel-modules-and-device-drivers-1233050713693744-1Troubleshooting linux-kernel-modules-and-device-drivers-1233050713693744-1
Troubleshooting linux-kernel-modules-and-device-drivers-1233050713693744-1
 
unit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptxunit 1ARM INTRODUCTION.pptx
unit 1ARM INTRODUCTION.pptx
 
LCA13: CPUIDLE: One driver to rule them all?
LCA13: CPUIDLE: One driver to rule them all?LCA13: CPUIDLE: One driver to rule them all?
LCA13: CPUIDLE: One driver to rule them all?
 
An Introduction to the Formalised Memory Model for Linux Kernel
An Introduction to the Formalised Memory Model for Linux KernelAn Introduction to the Formalised Memory Model for Linux Kernel
An Introduction to the Formalised Memory Model for Linux Kernel
 
Automation-PLC
Automation-PLCAutomation-PLC
Automation-PLC
 
Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)Intro to micro controller (Atmega16)
Intro to micro controller (Atmega16)
 
SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016
 

More from 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 GalloLinaro
 
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 VekariaLinaro
 
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 MoraLinaro
 
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 qaLinaro
 
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 2018Linaro
 
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 2018Linaro
 
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 ...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
 
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...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 mainlineLinaro
 
HKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteHKG18-100K1 - George Grey: Opening Keynote
HKG18-100K1 - George Grey: Opening KeynoteLinaro
 
HKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopHKG18-318 - OpenAMP Workshop
HKG18-318 - OpenAMP WorkshopLinaro
 
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 mainlineLinaro
 
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 allLinaro
 
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 HypervisorLinaro
 
HKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMUHKG18-TR08 - Upstreaming SVE in QEMU
HKG18-TR08 - Upstreaming SVE in QEMULinaro
 
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.MX8MLinaro
 
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 bootLinaro
 

More from 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
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

LCA13: Who Disturbs My Slumber

  • 1. More about Linaro Connect: connect.linaro.org More about Linaro: www.linaro.org/about/ More about Linaro engineering: www.linaro.org/engineering/ Hong-Kong (LCE13)
  • 2. 2 EUROPE 2012 (LCE12) www.linaro.org Linaro Connect Hong-Kong 2013 Who disturbs my slumber ?!
  • 3. 3 EUROPE 2012 (LCE12) www.linaro.org Introduction The power management is a wide area Power aware scheduler, P-States, C-States, optimizations for idling the cpu, regulators ... We will focus on the sources of wake up for ARM architecture
  • 5. 5 EUROPE 2012 (LCE12) www.linaro.org Introduction “Idle” opposite to “Running”, in between an event occurs. We want a cpu to be idle as much as possible without impacting the performance of the system The cpuidle framework takes care of entering the idle state depending on the predictable events on the system The depth of the sleep will depend on the next event on the system What is this event ? An interrupt.
  • 6. 6 EUROPE 2012 (LCE12) www.linaro.org Idle vs Running When there is no more tasks to run, the scheduler choose the special idle task This one is an infinite loop entering and exiting the arch specific idle function When an interrupt occurs, the function exits and the idle task is yield or enters again into the idle function
  • 9. 9 EUROPE 2012 (LCE12) www.linaro.org Package Idle The deep idle state could be reached only when all cpus are idle One cpu exiting the idle state will lead the package to exit the idle state also Software idle states management is challenging on multicore SoCs
  • 11. 11 EUROPE 2012 (LCE12) www.linaro.org /proc/interrupts – Snowball U8500 CPU0 CPU1 29: 3150 4124 GIC twd 36: 783 0 GIC Nomadik Timer Tick ... 57: 1592 0 GIC dma40 58: 73 0 GIC uart-pl011 72: 0 0 GIC ab8500 79: 187 0 GIC prcmu 87: 0 0 GIC nmk-i2c 92: 4687 0 GIC mmci-pl18x (cmd) 131: 14897 0 GIC mmci-pl18x (cmd) ... IPI0: 0 0 CPU wakeup interrupts IPI1: 0 167 Timer broadcast interrupts IPI2: 386 4908 Rescheduling interrupts IPI3: 0 0 Function call interrupts IPI4: 3 67 Single function call interrupts IPI5: 0 0 CPU stop interrupts Err: 0
  • 12. 12 EUROPE 2012 (LCE12) www.linaro.org /proc/interrupts – Pandaboard OMAP4 CPU0 CPU1 29: 293 395 GIC twd 41: 0 0 GIC l3-dbg-irq 42: 0 0 GIC l3-app-irq 44: 0 0 GIC DMA 69: 61 0 GIC gp_timer 88: 0 0 GIC i2c.9 89: 0 0 GIC i2c.10 93: 0 0 GIC i2c.11 94: 0 0 GIC i2c.12 106: 93 0 GIC OMAP UART2 169: 0 0 PRCM hwmod_io IPI0: 0 0 Timer broadcast interrupts IPI1: 1424 1260 Rescheduling interrupts IPI2: 0 0 Function call interrupts IPI3: 81 90 Single function call interrupts IPI4: 0 0 CPU stop interrupts Err: 0
  • 13. 13 EUROPE 2012 (LCE12) www.linaro.org Challenging the interrupts Where are they coming from ? When do they occur ? How can we reduce them ?
  • 14. 14 EUROPE 2012 (LCE12) www.linaro.org From where ? Hardware interrupt Network, keyboard, mouse, timer, MMC, USB, serial, ... Inter Processor Interrupt : Wisely used today, they are tricky to optimize The architecture differs across the SoC vendor but they are slightly similar for the IPI
  • 15. 15 EUROPE 2012 (LCE12) www.linaro.org Hardware interrupt HW interrupt can happen at arbitrary times The system could be tweaked depending on the hardware One deterministic interrupt is interesting : the timer
  • 16. 16 EUROPE 2012 (LCE12) www.linaro.org Hardware interrupt Interrupt Deterministic Comment Network No The network stack switch to polling on high traffic Keyboard No Mouse No MMC No Timer Yes Two kinds of timer USB No Serial No
  • 17. 17 EUROPE 2012 (LCE12) www.linaro.org Timers A complex infrastructure to handle most of the kernel and time services for userspace programs Two kinds of timer Per cpu timer Global timer
  • 18. 18 EUROPE 2012 (LCE12) www.linaro.org Timers Timer Watchdog (twd) The timer is local to the CPU Also known as “local timer” It goes down when the processor logic is shutdown Timer device (architecture dependant) Less accurate (eg. 32KHz) Usually always out of the CPU’s power domain Used as backup when the CPU are sleeping
  • 19. 19 EUROPE 2012 (LCE12) www.linaro.org Timers Used by the kernel for: Network stack, especially the TCP/IP protocol Timed-out IO Delayed work queues Scheduling tasks ... Used by the userspace for: Asynchronous IO and timeout Threading timed lock Mainloop (poll, epoll, select) Posix timers ... In other words : widely used in the system
  • 20. 20 EUROPE 2012 (LCE12) www.linaro.org IPI : Inter Processor Interrupt A softirq Limited to 16 on ARM with the GIC 5 used nowadays IPI0 : defined but unused so far IPI1 : timer broadcast IPI2 : Rescheduling interrupt IPI3 : Function Call interrupt IPI4 : Single Function Call interrupt IPI5 : Cpu Stop interrupt
  • 21. 21 EUROPE 2012 (LCE12) www.linaro.org IPI1 : Timer broadcast (1/3) Occurs only if SMP and cpuidle with at least retention mode state Broadcast interrupt could occur on any cpu: idle or not concerned by the timer expiration or not Could be optimized with dynamic timer irq affinity https://lkml.org/lkml/2013/2/19/555 A summary of how timer broadcast works https://lkml.org/lkml/2013/2/20/216
  • 22. 22 EUROPE 2012 (LCE12) www.linaro.org IPI1 : Timer broadcast (2/3) [1] : the cpuidle driver tells the time framework the local timer is no longer a valid source [2] : the timer framework changes the source and program the timer device [3] / [3'] : the cpuidle driver power downs the cpus
  • 23. 23 EUROPE 2012 (LCE12) www.linaro.org IPI1 : Timer broadcast (3/3) [1] : the timer expires raising an interrupt [2] : the cpu is woken up [3] : the cpu handles the timer callback and through the time framework … [4] … it sends an IPI to the cpu which are concerned by the expiration of this timer
  • 24. 24 EUROPE 2012 (LCE12) www.linaro.org IPI2 : Rescheduling interrupt (1/4) Used by the scheduler to wake up a processor in order to run a task Could happen for different reasons: Load balancing / process migration An event occurs for a specific task IO (eg. network ingress packet) A lock has been released for a blocked task Signal delivery
  • 25. 25 EUROPE 2012 (LCE12) www.linaro.org IPI2 : Rescheduling interrupt (2/4) CPU0 is running an application CPU1 is idle A task on CPU1 is blocked on a lock
  • 26. 26 EUROPE 2012 (LCE12) www.linaro.org IPI2 : Rescheduling interrupt (3/4) The application on CPU0 releases the lock The scheduler takes the decision to wake up the CPU1... … and send an IPI to it
  • 27. 27 EUROPE 2012 (LCE12) www.linaro.org IPI2 : Rescheduling interrupt (4/4) The CPU1 is awake The scheduler put in the run queue the task which was previously blocked
  • 28. 28 EUROPE 2012 (LCE12) www.linaro.org IPI3 : Function Call interrupt Used to do a remote function invocation on all the CPUs when the code must be run in the processor context Setting the timer frequency Setting up the clock event notify framework It happens rarely on the ARM system, but often on x86 system under the term of “TLB shootdowns” which happens at fork time
  • 29. 29 EUROPE 2012 (LCE12) www.linaro.org IPI3 : Function Call interrupt Used to do a remote function invocation on all the CPUs when the code must be run in the processor context Setting the timer frequency Setting up the clock event notify framework It happens rarely on the ARM system, but often on x86 system under the term of “TLB shootdowns” which happens at fork time
  • 30. 30 EUROPE 2012 (LCE12) www.linaro.org IPI4 : Single Function Call interrupt Same as the IPI3 but for a targeted CPU Happens rarely on the system
  • 31. 31 EUROPE 2012 (LCE12) www.linaro.org How to reduce the number of interrupts ? Understand the framework and identify the unnecessary wake up Deferrable timers http://lwn.net/Articles/228143/ Round jiffies http://lkml.org/lkml/2006/10/10/189 RCU no callback http://lwn.net/Articles/522262 Timer and workqueue migration on non idle cpu https://lkml.org/lkml/2012/9/27/188
  • 32. 32 EUROPE 2012 (LCE12) www.linaro.org Deferrable timers Used for non critical timers and change their expiration to occur when the CPU wakes up How to use it ? Identify non critical timers Flag them deferrable They will be handled when the CPU wakes up for another reason
  • 33. 33 EUROPE 2012 (LCE12) www.linaro.org Round jiffies Used to group timers to expire at the same time slot How to use it ? Identify timers for non precise timeout Group them to the same time slot by using round_jiffies
  • 34. 34 EUROPE 2012 (LCE12) www.linaro.org Timer and workqueue migration Schedule work onto running CPUs instead of waking up an idle one Still work in progress
  • 35. 35 EUROPE 2012 (LCE12) www.linaro.org Misc improvements The kernel does not do everything, userspace applications have to be improved for power management The application could group the timers to expire at the same time if high precision is not needed Round-jiffies like framework ? A specific flag for timer syscalls, in order to make them deferrable ? prctl : PR_SET_TIMERSLACK
  • 36. 36 EUROPE 2012 (LCE12) www.linaro.org Misc improvements Kill all busyloop and replace them with an event based mainloop timerfd, signalfd, eventfd, etc … Increase MTU size for private network area when possible Use CPU affinity when multiple tasks have to run to sequentially Put pressure on developers to fix the applications and make them more power aware, the kernel can not overcome bad applications