SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Runtime PM for CPU
Idling in Linux Kernel
“freedom” Koan-Sin Tan
freedom_at_computer.org
unconf, COSCUP 2016
Most of the materials are from Kevin, Ulf, and Lina’s past Linaro Connect
presentations
SoC Idling & CPU Cluster PM
● Idle management of devices via Runtime
PM and the Generic PM Domain (genpd)
○ A proven concept
● Idle management of CPUs and clusters
(cpuidle)
● Goal: One “idle” to rule them all!
● http://lwn.net/Articles/696712/
○ [PATCH v3 00/15] PM: SoC idle support using
PM domains, Thu, 4 Aug 2016 17:04:47 -0600
https://en.wikipedia.org/wiki/One_Ring
Background
● Runtime PM
● System PM
● DevPM QoS
○ CPU_DMA_LATENCY
○ https://www.kernel.org/doc/Documentation/power/pm_qos_interface.txt
● Generic PM domain
https://events.linuxfoundation.org/images/stories/pdf/lceu2012_wysocki.pdf
Users of genpd
SH-Mobile
SH-Mobile
S3C64xx
Exynos
SH-Mobile
S3C64xx
Exynos
SH-Mobile
S3C64xx
Exynos
IMX
Ux500
ZX
Qcom
BCM
Dove
MediaTek
Rockchip
Tegra
Linux 3.1 Linux 3.4 Linux 3.18 Linux 4.5
Highlight
● Genpd: maintained by Ulf, Kevin, and Rafael
● Various consolidation, fixing issues and regressions
○ Genpd: Removing intermediate states from the power off sequence (4.3)
■ http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/base?id=ba2bbfbf63075850bb523e
2adb815d45e3509995
○ Genpd: Enable the runtime PM centric approach
○ Genpd: Support multiple retention states (4.6)
Next steps
● Add genpd power statistics
● Avoid needless wakeup in System PM
CPU Cluster PM: background and motivation
More
● CPUs
● integrated devices
● power domains
● micro controllers
● firmware
Kernel needs to evolve
Idle management today
● The linux kernel has two distinct ways of managing idle.
● The CPUidle framework for CPUs and for all other devices: runtime PM
combined with generic power domains (genpd). In addition, CPUidle is not
scaling well for multi-cluster SMP systems and heterogeneous systems like
big.LITTLE
● To better manage idle for modern SoCs with a hierarchical structure, we are
exploring extending runtime PM and genpd to CPUs so there is a unified
framework for managing idle across all devices
Two separate worlds
CPU
● cpuidle framework
● cpu_(cluster_)pm_*()
● Not scaling well for SMP or multi-cluster
(c.f. Coupled idle states)
[1]
https://www.linuxplumbersconf.org/2012/wp-cont
ent/uploads/2012/09/cpuidle-cluster.pdf
IO devices
● Runtime PM
● Auto suspend
● PM domains
● Generic PM domains (genpd)
[1]
https://events.linuxfoundation.org/images/stories
/pdf/lcjp2012_wysocki.pdf
Runtime PM + genpd SoC Idle
Including
● User runtime PM for CPUS
● And CPU-connected “stuff”
○ Interrupt controllers (e.g., ARM GIC)
○ FPUs
○ CPU-local cache (L1 $)
● Model cluster with genpd
○ CPUs are just “devices” in the genpd
○ Genpd includes share resources (e.g., L2 $)
SoC/Cluster Idle - Solution
● Use genpd and Runtime PM
● Describe CPUS and domains in DT
○ CPU: #power-domains = <&CPU_PD0>;
○ power-controller: #power-domains-cells;
● Initialize genpd PM domains
● Attach CPU devices to genpd
● Add Runtime PM support for CPUidle and Hotplug
● Provide platform callbacks
CPU
cpuidle
cpuidle
SoC Idle: Today
CPUCPU
CPUCPU
CPUCPU
CPUCPU
cpuidle
cpuidle
cpuidle
cpuidlecpuidle
cpuidle
CLUSTER COHERENCY
?? ?
Platform
hacks
CLUSTER &
COHERENCY
SoC Idle: With CPU PM
CPU
cpuidle
cpuidle
CPUCPU
CPUCPU
CPUCPU
CPUCPU
cpuidle
cpuidle
cpuidle
cpuidlecpuidle
cpuidle
Runtime
PM
GenPD CPU PM
Platform
Driver
Recipe
● Started with upstream kernel (latest kernel I tested is 4.7)
● Prep
○ Extend genpd domains to support multiple idle levels
○ Extend genpd to support IRQ-safe PM domains
● Add
○ Add CPU PM domain framework
○ Call Runtime PM from cpuidle
● Sample
○ Using CPU PM domains: OS Initiated
○ DT changes for SoC
https://github.com/freedomtan/linux/commits/v4.7-rc1-mt8173-soc-idle
CPU PM framework
● Init
○ Read domain topology from DT
○ Setup genpd PM domains
● Genpd
○ Last man determination
● Genpd gov:
○ Determine cluster idle state
GenPD
Platform
Driver
CPU PM
GenPD
GenPD
Governor
Init
CPU PM domains
● Add CPU PM domain framework
○ Define CPUs as IRQ-safe devices
■ https://patches.linaro.org/patch/63350/
○ Read CPU topology from DT
○ Register domains and set up sub-domains
○ Add online CPUs to the respective CPU PM domains
○ Register for hotplug notifications to understand online CPUs
■ https://patches.linaro.org/patch/63352/
○ Add CPU Runtime PM API for ease of use
○ Add a new genpd governor for CPU domains that takes PM QoS into consideration
● Call CPU Runtime PM from ARM cpuidle driver
○ Use CPU PM domain runtime suspend and resume API
○ Record the next wake time of this CPU in the device’s genpd data for use by governor
https://github.com/freedomtan/linux/blob/v4.7-rc1-mt8173-soc-idle/drivers/base/power/cpu_domains.c
CPU PM framework
● Better than couple cpuidle
○ CPUs are not woken up when ready to enter coupled state
○ Handle multi-level CPU-domain topology
● Is not MCPM
○ MCPM handles low level race between CPUs
○ Some v7 SoCs may still need MCPU with CPU PM framework
PSCI: PC vs. OSI
Platform Coordinated (PC)
● Default PSCI mode
● FW decides on CPU-Domain idle state
when all CPUs are idle
● FW does not know of LInux CPU QoS
requirements, latency and next CPU
wakeup
● FW decision to power off domain may be
detrimental to power and performance
OS Initiated (OSI)
● Options from PSCI v1.0 onward
● Linux decides the CPU-Domain idle state
● The last CPU in a domain provides the idle
state of the cluster, coherency
● Linux can make a wise choice of
CPU-Domain idle state knowing QoS,
latency, predicated CPU wakeup
OSI using CPU PM
● Query PSCI_FEATURES in F/W for OSI support
● Setup CPU PM Domains
○ Reads State-IDs for Cluster and Coherency idle levels from DT
● Callbacks for Domain ON/OFF
○ State-IDs passed from CPU PM
○ Aggregate State-IDs against the CPU
● CPU calls F/W with Composite State-ID
● NO SoC specific drivers needed for ARM v8
PSCI: Composite State-ID
● CPUidle: CPU state
● CPU PM Gov: Cluster state
● CPU PM Gov: Coherency state
cpu_suspend(uint32 power_state, ....)
Bit field Description
31:26 Reserved. Must be zero
25:24 PowerLevel
23:17 Reserved. Must be zero.
16 State Type
15:0 StateID
Bit field Description
31 Reserved. Must be zero
30 StateType
29:28 Reserved. Must be zero.
27:0 StateID
Original Format Extended StateID Format
Original Format
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Last in level System Cluster CPU
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved: must be 0 Power
Level
Reserved: must be 0 State
type
CPU idle: 0x00010000
Cluster idle: 0x01010000
StateID: not used
Extended ID
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Last in level System Cluster CPU
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 Reserved:
must be 0
State
type
StateID
Changes for Vendors: ARM64
● DT
○ Domain hierarchy
○ Domain idle states
● Driver
○ None if F/W supports OS Initiated mode
Changes for Vendors: ARMv7
● DT
○ Domain hierarchy
○ Domain idle states
● Driver
○ Handle power ON/OFF callbacks
○ MCPM or any race avoiding last man logic
● Revisit SoC specific CPUidle hacks
Genpd: IRQ-Safe Restriction
● IRQ-safe domains can only have IRQ-safe sub-domains
● Other cases with domains and devices remains the same
Status of patches
● PM / Domains: Multiple genpd states: Merged
● PM / Doamins: IRQ safe domains: Under review
○ http://www.spinics.net/lists/linux-arm-msm/msg19666.html
● CPU PM domains: new framework for CPU cluster: Under review
○ http://www.spinics.net/lists/linux-arm-msm/msg19667.html
● PSCI 1.0 OS Initiated: Support for domain hierarchy: Under review
○ http://www.spinics.net/lists/linux-arm-msm/msg19673.html
○ http://www.spinics.net/lists/linux-arm-msm/msg19674.html
RFC submission on ML:
[1]. Patch v3: http://lwn.net/Articles/696712/
Sample ARM v7a implementation
[2]. https://git.linaro.org/people/lina.iyer/linux-next.git/shortlog/refs/heads/genpd-psci-8084
Results
● SoC idle saves power when CPUs are online
○ Critical power saving comes from powering off caches and peripheral h/w
○ ~20 mA @800 Mhz of power saving at idle
● ~5 μs addition to idle enter path
○ Exit latency depends on what happens at domain OFF
● Implemented and tested on DB410c / 96Board
● Implemented and tested on MT8173 EVB and Chromebook OAK rev-5
● Some result measured with Servo board
INFO: CPU Node : MPID 0x0, parent_node 1, State 0x0
INFO: CPU Node : MPID 0x1, parent_node 1, State 0x0
INFO: CPU Node : MPID 0xffffffffffffffff, parent_node 1, State 0x2
INFO: CPU Node : MPID 0xffffffffffffffff, parent_node 1, State 0x2
INFO: CPU Node : MPID 0x100, parent_node 2, State 0x0
INFO: CPU Node : MPID 0x101, parent_node 2, State 0x0
INFO: mode = 0x1
What changes are needed
● Linux kernel
○ Runtime PM
○ Generic PM domain (genpd)
○ Some patches (likely to be merged into mainline kernel when good enough)
○ dts changes
● PSCI (ATF)
○ OS Initiated: not supported in ATF
○ Extended ID: enable it
○ By the time I started working on it, the code in plat/mediatek/ still uses backward compatible
API (ENABLE_PLAT_COMPAT)
■ Cannot enable Extended ID
Links
● Linux Kernel
○ genpd + runtime pm SoC idle
■ Patches V3, http://lwn.net/Articles/696712/
○ Ulfh’s linux-pm next branch
■ https://git.linaro.org/people/ulf.hansson/linux-pm.git
■ https://git.linaro.org/people/ulf.hansson/linux-pm.git/shortlog/refs/heads/next
○ My dts changes for MT8173 (based on Ulf’s next branch)
■ https://git.linaro.org/people/freedom.tan/linux-8173.git/shortlog/refs/heads/v4.6-rc6-mt817
3-soc-idle
● ARM Trusted Firmware (ATF)
○ https://github.com/freedomtan/arm-trusted-firmware/tree/hacks-for-8173evb-osi-0518
1. PM / Domains: Abstract genpd locking
2. PM / Domains: Support IRQ safe PM domains
3. PM / cpu_domains: Setup PM domains for CPUs/clusters
4. ARM: cpuidle: Add runtime PM support for CPUs
5. timer: Export next wake up of a CPU
6. PM / cpu_domains: Record CPUs that are part of the domain
7. PM / cpu_domains: Add PM Domain governor for CPUs
8. Documentation / cpu_domains: Describe CPU PM domains
setup and governor
9. drivers: firmware: psci: Allow OS Initiated suspend mode
10. ARM64: psci: Support cluster idle states for OS-Initiated
11. ARM64: dts: Add PSCI cpuidle support for MSM8916
12. ARM64: dts: Define CPU power domain for MSM8916
Documentation/power/cpu_domains.txt | 79 ++++++++
Documentation/power/devices.txt | 12 +-
arch/arm64/boot/dts/qcom/msm8916.dtsi | 49 +++++
arch/arm64/kernel/psci.c | 46 ++++-
drivers/base/power/Makefile | 1 +
drivers/base/power/cpu_domains.c | 365 ++++++++++++++++++++++++++++++++++
drivers/base/power/domain.c | 210 +++++++++++++++----
drivers/cpuidle/cpuidle-arm.c | 55 +++++
drivers/firmware/psci.c | 45 ++++-
include/linux/cpu_domains.h | 37 ++++
include/linux/pm_domain.h | 14 +-
include/linux/psci.h | 2 +
include/linux/tick.h | 10 +
include/uapi/linux/psci.h | 5 +
kernel/time/tick-sched.c | 13 ++
15 files changed, 896 insertions(+), 47 deletions(-)
create mode 100644 Documentation/power/cpu_domains.txt
create mode 100644 drivers/base/power/cpu_domains.c
create mode 100644 include/linux/cpu_domains.h
Description of Patches
● Patches [1, 2] - Genpd changes. Sets up Generic PM domains
to be called from cpuidle. Genpd uses mutexes for
synchronization. This has to be changed to spinlocks for
domains that may be called from IRQ safe contexts.
● Patch [3] - CPU PM domains. Parses DT and sets up PM
domains for CPUs and builds up the hierarchy of domains
and devices. These are bunch of helper functions.
● Patch [4] - ARM cpuidle driver. Enable ARM cpuidle driver to
call runtime PM. Even though this has been done for ARM,
there is nothing architecture specific about this. Currently, all
idle states other than ARM clock gating calls into runtime
PM. This could also be state specific i.e call into runtime PM
only after a certain state. The changes may be made part of
cpuidle framework, but needs discussion.
● Patches [5, 6, 7] - PM domain governor for CPUs.
Introduces a new genpd governor that looks into the
per-CPU tick device to identify the next CPU wakeup and
determine the available sleep time for the domain. This
along with QoS is used to determine the best idle state for
the domain. A domains' wake up is determined by the first
CPU in that domain to wake up. A coherency level domain's
(parent of a domain containing CPU devices)
wake up is determined by the first CPU amongst all the
CPUs to wake up. Identifying the CPUs and their wakeups
are the part of these patches.
● Patches [9, 10] - ARM64 PSCI platform driver
ARM64 PSCI v1.0 specific. PSCI OS initiated mode. supports
powering off CPU clusters (caches etc, by configuring
separate power controllers). These patches
enable Linux to determine if the f/w supports this mode and
if so, uses CPU PM domain helper functions to create PM
domains and handles the power_on/power_off
callbacks. The resulting cluster state is passed as an
argument to the f/w along with the CPU state.
RFCv3 patches
[1] https://patches.linaro.org/patch/63349/
[2] https://patches.linaro.org/patch/63350/
[3] https://patches.linaro.org/patch/63351/
[4] https://patches.linaro.org/patch/63352/
[5] https://patches.linaro.org/patch/63353/
[6] https://patches.linaro.org/patch/63354/
[7] https://patches.linaro.org/patch/63355/
[8] https://patches.linaro.org/patch/63356/
[9] https://patches.linaro.org/patch/63357/
[10] https://patches.linaro.org/patch/63358/
[11] https://patches.linaro.org/patch/63359/
[12] https://patches.linaro.org/patch/63360/

Contenu connexe

Tendances

Tendances (20)

OVS and DPDK - T.F. Herbert, K. Traynor, M. Gray
OVS and DPDK - T.F. Herbert, K. Traynor, M. GrayOVS and DPDK - T.F. Herbert, K. Traynor, M. Gray
OVS and DPDK - T.F. Herbert, K. Traynor, M. Gray
 
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
 
Linux Kernel Debugging
Linux Kernel DebuggingLinux Kernel Debugging
Linux Kernel Debugging
 
The Spectre of Meltdowns
The Spectre of MeltdownsThe Spectre of Meltdowns
The Spectre of Meltdowns
 
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP IntegrationBKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
BKK16-409 VOSY Switch Port to ARMv8 Platforms and ODP Integration
 
Vigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick startVigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick start
 
BKK16-308 The tool called Auto-Tuned Optimization System (ATOS)
BKK16-308 The tool called Auto-Tuned Optimization System (ATOS)BKK16-308 The tool called Auto-Tuned Optimization System (ATOS)
BKK16-308 The tool called Auto-Tuned Optimization System (ATOS)
 
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
 
FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)
 
Performance Lessons learned in vRouter - Stephen Hemminger
Performance Lessons learned in vRouter - Stephen HemmingerPerformance Lessons learned in vRouter - Stephen Hemminger
Performance Lessons learned in vRouter - Stephen Hemminger
 
EBPF and Linux Networking
EBPF and Linux NetworkingEBPF and Linux Networking
EBPF and Linux Networking
 
7 hands on
7 hands on7 hands on
7 hands on
 
Kernel Recipes 2015 - The Dronecode Project – A step in open source drones
Kernel Recipes 2015 - The Dronecode Project – A step in open source dronesKernel Recipes 2015 - The Dronecode Project – A step in open source drones
Kernel Recipes 2015 - The Dronecode Project – A step in open source drones
 
BKK16-505 Kernel and Bootloader Consolidation and Upstreaming
BKK16-505 Kernel and Bootloader Consolidation and UpstreamingBKK16-505 Kernel and Bootloader Consolidation and Upstreaming
BKK16-505 Kernel and Bootloader Consolidation and Upstreaming
 
BKK16-400A LuvOS and ACPI Compliance Testing
BKK16-400A LuvOS and ACPI Compliance TestingBKK16-400A LuvOS and ACPI Compliance Testing
BKK16-400A LuvOS and ACPI Compliance Testing
 
6 open capi_meetup_in_japan_final
6 open capi_meetup_in_japan_final6 open capi_meetup_in_japan_final
6 open capi_meetup_in_japan_final
 
Howto createOpenFlow Switchusing FPGA (at FPGAX#6)
Howto createOpenFlow Switchusing FPGA (at FPGAX#6)Howto createOpenFlow Switchusing FPGA (at FPGAX#6)
Howto createOpenFlow Switchusing FPGA (at FPGAX#6)
 
5 p9 pnor and open bmc overview - final
5 p9 pnor and open bmc overview - final5 p9 pnor and open bmc overview - final
5 p9 pnor and open bmc overview - final
 
LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel Awareness
 
4. open mano set up and usage
4. open mano set up and usage4. open mano set up and usage
4. open mano set up and usage
 

Similaire à SoC Idling for unconf COSCUP 2016

Exploring Compiler Optimization Opportunities for the OpenMP 4.x Accelerator...
Exploring Compiler Optimization Opportunities for the OpenMP 4.x Accelerator...Exploring Compiler Optimization Opportunities for the OpenMP 4.x Accelerator...
Exploring Compiler Optimization Opportunities for the OpenMP 4.x Accelerator...
Akihiro Hayashi
 
Advanced Diagnostics 2
Advanced Diagnostics 2Advanced Diagnostics 2
Advanced Diagnostics 2
Aero Plane
 

Similaire à SoC Idling for unconf COSCUP 2016 (20)

Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Bsdtw17: ruslan bukin: free bsd/risc-v and device driversBsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case study
 
100Gbps OpenStack For Providing High-Performance NFV
100Gbps OpenStack For Providing High-Performance NFV100Gbps OpenStack For Providing High-Performance NFV
100Gbps OpenStack For Providing High-Performance NFV
 
Exploring Compiler Optimization Opportunities for the OpenMP 4.x Accelerator...
Exploring Compiler Optimization Opportunities for the OpenMP 4.x Accelerator...Exploring Compiler Optimization Opportunities for the OpenMP 4.x Accelerator...
Exploring Compiler Optimization Opportunities for the OpenMP 4.x Accelerator...
 
Current and Future of Non-Volatile Memory on Linux
Current and Future of Non-Volatile Memory on LinuxCurrent and Future of Non-Volatile Memory on Linux
Current and Future of Non-Volatile Memory on Linux
 
Advanced Diagnostics 2
Advanced Diagnostics 2Advanced Diagnostics 2
Advanced Diagnostics 2
 
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and Insights
 
Nvidia tegra K1 Presentation
Nvidia tegra K1 PresentationNvidia tegra K1 Presentation
Nvidia tegra K1 Presentation
 
µCLinux on Pluto 6 Project presentation
µCLinux on Pluto 6 Project presentationµCLinux on Pluto 6 Project presentation
µCLinux on Pluto 6 Project presentation
 
SFO15-502: Using generic cpuidle framework for ARM/ARM64 in your driver
SFO15-502: Using generic cpuidle framework for ARM/ARM64 in your driverSFO15-502: Using generic cpuidle framework for ARM/ARM64 in your driver
SFO15-502: Using generic cpuidle framework for ARM/ARM64 in your driver
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509
 
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?
 
Measuring a 25 and 40Gb/s Data Plane
Measuring a 25 and 40Gb/s Data PlaneMeasuring a 25 and 40Gb/s Data Plane
Measuring a 25 and 40Gb/s Data Plane
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
 
Challenges in GPU compilers
Challenges in GPU compilersChallenges in GPU compilers
Challenges in GPU compilers
 
UKUUG presentation about µCLinux on Pluto 6
UKUUG presentation about µCLinux on Pluto 6UKUUG presentation about µCLinux on Pluto 6
UKUUG presentation about µCLinux on Pluto 6
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
 

Plus de Koan-Sin Tan

Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android Benchmarks
Koan-Sin Tan
 
Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source SolutionsDark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
Koan-Sin Tan
 

Plus de Koan-Sin Tan (18)

running stable diffusion on android
running stable diffusion on androidrunning stable diffusion on android
running stable diffusion on android
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source Tools
 
A Peek into TFRT
A Peek into TFRTA Peek into TFRT
A Peek into TFRT
 
Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020
 
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source ToolExploring Thermal Related Stuff in iDevices using Open-Source Tool
Exploring Thermal Related Stuff in iDevices using Open-Source Tool
 
TFLite NNAPI and GPU Delegates
TFLite NNAPI and GPU DelegatesTFLite NNAPI and GPU Delegates
TFLite NNAPI and GPU Delegates
 
A Sneak Peek of MLIR in TensorFlow
A Sneak Peek of MLIR in TensorFlowA Sneak Peek of MLIR in TensorFlow
A Sneak Peek of MLIR in TensorFlow
 
A Peek into Google's Edge TPU
A Peek into Google's Edge TPUA Peek into Google's Edge TPU
A Peek into Google's Edge TPU
 
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
Why You Cannot Use Neural Engine to Run Your NN Models on A11 Devices?
 
open source nn frameworks on cellphones
open source nn frameworks on cellphonesopen source nn frameworks on cellphones
open source nn frameworks on cellphones
 
Caffe2 on Android
Caffe2 on AndroidCaffe2 on Android
Caffe2 on Android
 
Introduction to TensorFlow Lite
Introduction to TensorFlow Lite Introduction to TensorFlow Lite
Introduction to TensorFlow Lite
 
Tensorflow on Android
Tensorflow on AndroidTensorflow on Android
Tensorflow on Android
 
A peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk UserA peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk User
 
Android Wear and the Future of Smartwatch
Android Wear and the Future of SmartwatchAndroid Wear and the Future of Smartwatch
Android Wear and the Future of Smartwatch
 
Understanding Android Benchmarks
Understanding Android BenchmarksUnderstanding Android Benchmarks
Understanding Android Benchmarks
 
Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source SolutionsDark Silicon, Mobile Devices, and Possible Open-Source Solutions
Dark Silicon, Mobile Devices, and Possible Open-Source Solutions
 
Smalltalk and ruby - 2012-12-08
Smalltalk and ruby  - 2012-12-08Smalltalk and ruby  - 2012-12-08
Smalltalk and ruby - 2012-12-08
 

Dernier

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

SoC Idling for unconf COSCUP 2016

  • 1. Runtime PM for CPU Idling in Linux Kernel “freedom” Koan-Sin Tan freedom_at_computer.org unconf, COSCUP 2016 Most of the materials are from Kevin, Ulf, and Lina’s past Linaro Connect presentations
  • 2. SoC Idling & CPU Cluster PM ● Idle management of devices via Runtime PM and the Generic PM Domain (genpd) ○ A proven concept ● Idle management of CPUs and clusters (cpuidle) ● Goal: One “idle” to rule them all! ● http://lwn.net/Articles/696712/ ○ [PATCH v3 00/15] PM: SoC idle support using PM domains, Thu, 4 Aug 2016 17:04:47 -0600 https://en.wikipedia.org/wiki/One_Ring
  • 3.
  • 4. Background ● Runtime PM ● System PM ● DevPM QoS ○ CPU_DMA_LATENCY ○ https://www.kernel.org/doc/Documentation/power/pm_qos_interface.txt ● Generic PM domain https://events.linuxfoundation.org/images/stories/pdf/lceu2012_wysocki.pdf
  • 6. Highlight ● Genpd: maintained by Ulf, Kevin, and Rafael ● Various consolidation, fixing issues and regressions ○ Genpd: Removing intermediate states from the power off sequence (4.3) ■ http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/base?id=ba2bbfbf63075850bb523e 2adb815d45e3509995 ○ Genpd: Enable the runtime PM centric approach ○ Genpd: Support multiple retention states (4.6)
  • 7. Next steps ● Add genpd power statistics ● Avoid needless wakeup in System PM
  • 8. CPU Cluster PM: background and motivation More ● CPUs ● integrated devices ● power domains ● micro controllers ● firmware Kernel needs to evolve
  • 9. Idle management today ● The linux kernel has two distinct ways of managing idle. ● The CPUidle framework for CPUs and for all other devices: runtime PM combined with generic power domains (genpd). In addition, CPUidle is not scaling well for multi-cluster SMP systems and heterogeneous systems like big.LITTLE ● To better manage idle for modern SoCs with a hierarchical structure, we are exploring extending runtime PM and genpd to CPUs so there is a unified framework for managing idle across all devices
  • 10. Two separate worlds CPU ● cpuidle framework ● cpu_(cluster_)pm_*() ● Not scaling well for SMP or multi-cluster (c.f. Coupled idle states) [1] https://www.linuxplumbersconf.org/2012/wp-cont ent/uploads/2012/09/cpuidle-cluster.pdf IO devices ● Runtime PM ● Auto suspend ● PM domains ● Generic PM domains (genpd) [1] https://events.linuxfoundation.org/images/stories /pdf/lcjp2012_wysocki.pdf
  • 11. Runtime PM + genpd SoC Idle Including ● User runtime PM for CPUS ● And CPU-connected “stuff” ○ Interrupt controllers (e.g., ARM GIC) ○ FPUs ○ CPU-local cache (L1 $) ● Model cluster with genpd ○ CPUs are just “devices” in the genpd ○ Genpd includes share resources (e.g., L2 $)
  • 12. SoC/Cluster Idle - Solution ● Use genpd and Runtime PM ● Describe CPUS and domains in DT ○ CPU: #power-domains = <&CPU_PD0>; ○ power-controller: #power-domains-cells; ● Initialize genpd PM domains ● Attach CPU devices to genpd ● Add Runtime PM support for CPUidle and Hotplug ● Provide platform callbacks
  • 14. CLUSTER & COHERENCY SoC Idle: With CPU PM CPU cpuidle cpuidle CPUCPU CPUCPU CPUCPU CPUCPU cpuidle cpuidle cpuidle cpuidlecpuidle cpuidle Runtime PM GenPD CPU PM Platform Driver
  • 15. Recipe ● Started with upstream kernel (latest kernel I tested is 4.7) ● Prep ○ Extend genpd domains to support multiple idle levels ○ Extend genpd to support IRQ-safe PM domains ● Add ○ Add CPU PM domain framework ○ Call Runtime PM from cpuidle ● Sample ○ Using CPU PM domains: OS Initiated ○ DT changes for SoC https://github.com/freedomtan/linux/commits/v4.7-rc1-mt8173-soc-idle
  • 16. CPU PM framework ● Init ○ Read domain topology from DT ○ Setup genpd PM domains ● Genpd ○ Last man determination ● Genpd gov: ○ Determine cluster idle state GenPD Platform Driver CPU PM GenPD GenPD Governor Init
  • 17. CPU PM domains ● Add CPU PM domain framework ○ Define CPUs as IRQ-safe devices ■ https://patches.linaro.org/patch/63350/ ○ Read CPU topology from DT ○ Register domains and set up sub-domains ○ Add online CPUs to the respective CPU PM domains ○ Register for hotplug notifications to understand online CPUs ■ https://patches.linaro.org/patch/63352/ ○ Add CPU Runtime PM API for ease of use ○ Add a new genpd governor for CPU domains that takes PM QoS into consideration ● Call CPU Runtime PM from ARM cpuidle driver ○ Use CPU PM domain runtime suspend and resume API ○ Record the next wake time of this CPU in the device’s genpd data for use by governor https://github.com/freedomtan/linux/blob/v4.7-rc1-mt8173-soc-idle/drivers/base/power/cpu_domains.c
  • 18. CPU PM framework ● Better than couple cpuidle ○ CPUs are not woken up when ready to enter coupled state ○ Handle multi-level CPU-domain topology ● Is not MCPM ○ MCPM handles low level race between CPUs ○ Some v7 SoCs may still need MCPU with CPU PM framework
  • 19. PSCI: PC vs. OSI Platform Coordinated (PC) ● Default PSCI mode ● FW decides on CPU-Domain idle state when all CPUs are idle ● FW does not know of LInux CPU QoS requirements, latency and next CPU wakeup ● FW decision to power off domain may be detrimental to power and performance OS Initiated (OSI) ● Options from PSCI v1.0 onward ● Linux decides the CPU-Domain idle state ● The last CPU in a domain provides the idle state of the cluster, coherency ● Linux can make a wise choice of CPU-Domain idle state knowing QoS, latency, predicated CPU wakeup
  • 20. OSI using CPU PM ● Query PSCI_FEATURES in F/W for OSI support ● Setup CPU PM Domains ○ Reads State-IDs for Cluster and Coherency idle levels from DT ● Callbacks for Domain ON/OFF ○ State-IDs passed from CPU PM ○ Aggregate State-IDs against the CPU ● CPU calls F/W with Composite State-ID ● NO SoC specific drivers needed for ARM v8
  • 21. PSCI: Composite State-ID ● CPUidle: CPU state ● CPU PM Gov: Cluster state ● CPU PM Gov: Coherency state
  • 22. cpu_suspend(uint32 power_state, ....) Bit field Description 31:26 Reserved. Must be zero 25:24 PowerLevel 23:17 Reserved. Must be zero. 16 State Type 15:0 StateID Bit field Description 31 Reserved. Must be zero 30 StateType 29:28 Reserved. Must be zero. 27:0 StateID Original Format Extended StateID Format
  • 23. Original Format 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Last in level System Cluster CPU 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 Reserved: must be 0 Power Level Reserved: must be 0 State type CPU idle: 0x00010000 Cluster idle: 0x01010000 StateID: not used
  • 24. Extended ID 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Last in level System Cluster CPU 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 0 Reserved: must be 0 State type StateID
  • 25. Changes for Vendors: ARM64 ● DT ○ Domain hierarchy ○ Domain idle states ● Driver ○ None if F/W supports OS Initiated mode
  • 26. Changes for Vendors: ARMv7 ● DT ○ Domain hierarchy ○ Domain idle states ● Driver ○ Handle power ON/OFF callbacks ○ MCPM or any race avoiding last man logic ● Revisit SoC specific CPUidle hacks
  • 27. Genpd: IRQ-Safe Restriction ● IRQ-safe domains can only have IRQ-safe sub-domains ● Other cases with domains and devices remains the same
  • 28. Status of patches ● PM / Domains: Multiple genpd states: Merged ● PM / Doamins: IRQ safe domains: Under review ○ http://www.spinics.net/lists/linux-arm-msm/msg19666.html ● CPU PM domains: new framework for CPU cluster: Under review ○ http://www.spinics.net/lists/linux-arm-msm/msg19667.html ● PSCI 1.0 OS Initiated: Support for domain hierarchy: Under review ○ http://www.spinics.net/lists/linux-arm-msm/msg19673.html ○ http://www.spinics.net/lists/linux-arm-msm/msg19674.html RFC submission on ML: [1]. Patch v3: http://lwn.net/Articles/696712/ Sample ARM v7a implementation [2]. https://git.linaro.org/people/lina.iyer/linux-next.git/shortlog/refs/heads/genpd-psci-8084
  • 29. Results ● SoC idle saves power when CPUs are online ○ Critical power saving comes from powering off caches and peripheral h/w ○ ~20 mA @800 Mhz of power saving at idle ● ~5 μs addition to idle enter path ○ Exit latency depends on what happens at domain OFF ● Implemented and tested on DB410c / 96Board ● Implemented and tested on MT8173 EVB and Chromebook OAK rev-5 ● Some result measured with Servo board
  • 30.
  • 31. INFO: CPU Node : MPID 0x0, parent_node 1, State 0x0 INFO: CPU Node : MPID 0x1, parent_node 1, State 0x0 INFO: CPU Node : MPID 0xffffffffffffffff, parent_node 1, State 0x2 INFO: CPU Node : MPID 0xffffffffffffffff, parent_node 1, State 0x2 INFO: CPU Node : MPID 0x100, parent_node 2, State 0x0 INFO: CPU Node : MPID 0x101, parent_node 2, State 0x0 INFO: mode = 0x1
  • 32. What changes are needed ● Linux kernel ○ Runtime PM ○ Generic PM domain (genpd) ○ Some patches (likely to be merged into mainline kernel when good enough) ○ dts changes ● PSCI (ATF) ○ OS Initiated: not supported in ATF ○ Extended ID: enable it ○ By the time I started working on it, the code in plat/mediatek/ still uses backward compatible API (ENABLE_PLAT_COMPAT) ■ Cannot enable Extended ID
  • 33. Links ● Linux Kernel ○ genpd + runtime pm SoC idle ■ Patches V3, http://lwn.net/Articles/696712/ ○ Ulfh’s linux-pm next branch ■ https://git.linaro.org/people/ulf.hansson/linux-pm.git ■ https://git.linaro.org/people/ulf.hansson/linux-pm.git/shortlog/refs/heads/next ○ My dts changes for MT8173 (based on Ulf’s next branch) ■ https://git.linaro.org/people/freedom.tan/linux-8173.git/shortlog/refs/heads/v4.6-rc6-mt817 3-soc-idle ● ARM Trusted Firmware (ATF) ○ https://github.com/freedomtan/arm-trusted-firmware/tree/hacks-for-8173evb-osi-0518
  • 34.
  • 35. 1. PM / Domains: Abstract genpd locking 2. PM / Domains: Support IRQ safe PM domains 3. PM / cpu_domains: Setup PM domains for CPUs/clusters 4. ARM: cpuidle: Add runtime PM support for CPUs 5. timer: Export next wake up of a CPU 6. PM / cpu_domains: Record CPUs that are part of the domain 7. PM / cpu_domains: Add PM Domain governor for CPUs 8. Documentation / cpu_domains: Describe CPU PM domains setup and governor 9. drivers: firmware: psci: Allow OS Initiated suspend mode 10. ARM64: psci: Support cluster idle states for OS-Initiated 11. ARM64: dts: Add PSCI cpuidle support for MSM8916 12. ARM64: dts: Define CPU power domain for MSM8916 Documentation/power/cpu_domains.txt | 79 ++++++++ Documentation/power/devices.txt | 12 +- arch/arm64/boot/dts/qcom/msm8916.dtsi | 49 +++++ arch/arm64/kernel/psci.c | 46 ++++- drivers/base/power/Makefile | 1 + drivers/base/power/cpu_domains.c | 365 ++++++++++++++++++++++++++++++++++ drivers/base/power/domain.c | 210 +++++++++++++++---- drivers/cpuidle/cpuidle-arm.c | 55 +++++ drivers/firmware/psci.c | 45 ++++- include/linux/cpu_domains.h | 37 ++++ include/linux/pm_domain.h | 14 +- include/linux/psci.h | 2 + include/linux/tick.h | 10 + include/uapi/linux/psci.h | 5 + kernel/time/tick-sched.c | 13 ++ 15 files changed, 896 insertions(+), 47 deletions(-) create mode 100644 Documentation/power/cpu_domains.txt create mode 100644 drivers/base/power/cpu_domains.c create mode 100644 include/linux/cpu_domains.h
  • 36. Description of Patches ● Patches [1, 2] - Genpd changes. Sets up Generic PM domains to be called from cpuidle. Genpd uses mutexes for synchronization. This has to be changed to spinlocks for domains that may be called from IRQ safe contexts. ● Patch [3] - CPU PM domains. Parses DT and sets up PM domains for CPUs and builds up the hierarchy of domains and devices. These are bunch of helper functions. ● Patch [4] - ARM cpuidle driver. Enable ARM cpuidle driver to call runtime PM. Even though this has been done for ARM, there is nothing architecture specific about this. Currently, all idle states other than ARM clock gating calls into runtime PM. This could also be state specific i.e call into runtime PM only after a certain state. The changes may be made part of cpuidle framework, but needs discussion. ● Patches [5, 6, 7] - PM domain governor for CPUs. Introduces a new genpd governor that looks into the per-CPU tick device to identify the next CPU wakeup and determine the available sleep time for the domain. This along with QoS is used to determine the best idle state for the domain. A domains' wake up is determined by the first CPU in that domain to wake up. A coherency level domain's (parent of a domain containing CPU devices) wake up is determined by the first CPU amongst all the CPUs to wake up. Identifying the CPUs and their wakeups are the part of these patches. ● Patches [9, 10] - ARM64 PSCI platform driver ARM64 PSCI v1.0 specific. PSCI OS initiated mode. supports powering off CPU clusters (caches etc, by configuring separate power controllers). These patches enable Linux to determine if the f/w supports this mode and if so, uses CPU PM domain helper functions to create PM domains and handles the power_on/power_off callbacks. The resulting cluster state is passed as an argument to the f/w along with the CPU state.
  • 37. RFCv3 patches [1] https://patches.linaro.org/patch/63349/ [2] https://patches.linaro.org/patch/63350/ [3] https://patches.linaro.org/patch/63351/ [4] https://patches.linaro.org/patch/63352/ [5] https://patches.linaro.org/patch/63353/ [6] https://patches.linaro.org/patch/63354/ [7] https://patches.linaro.org/patch/63355/ [8] https://patches.linaro.org/patch/63356/ [9] https://patches.linaro.org/patch/63357/ [10] https://patches.linaro.org/patch/63358/ [11] https://patches.linaro.org/patch/63359/ [12] https://patches.linaro.org/patch/63360/