SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
Don’t waste power when idle
Ulf Hansson, Linaro, PMWG
ENGINEERS AND DEVICES
WORKING TOGETHER
Agenda
● SoC idling - why, what, how?
● Overview of some PM frameworks.
● Deploy PM support - what methods?
● Deploy genpd support.
● Use the runtime PM centric approach and get system PM for free!
● Latest achievements and ongoing work.
● Some other interesting news.
ENGINEERS
AND DEVICES
WORKING
TOGETHER
SoC idling - why, what, how?
The why:
● Avoid wasting power when idle!
The what:
● CPUs are important, but it’s not enough.
● Lots of resources/devices can enter low power state(s).
The how:
● Solve common PM issues/corner-cases.
● Enable easy PM deployment for ARM SoCs.
ENGINEERS
AND DEVICES
WORKING
TOGETHER
Overview of some PM frameworks
● System PM
● Runtime PM
● PM domain
● The generic PM domain (aka genpd)
● Device PM QoS
ENGINEERS
AND DEVICES
WORKING
TOGETHER
System PM vs runtime PM
● System PM - system wide with all devices.
○ Closing the lid on your laptop.
○ Pressing the power button on your Android device.
○ Autosleep - when not prevented!
● Runtime PM - fine grained for any devices.
○ At request inactivity.
○ For unused, but enabled devices.
● Historically treated as two orthogonal PM frameworks.
○ CONFIG_PM_RUNTIME was merged into the CONFIG_PM.
○ pm_runtime_force_suspend|resume() helpers was added.
ENGINEERS AND DEVICES
WORKING TOGETHER
PM Domains
PM domain
DEV 0 DEV 1 DEV 2 DEV 4
Power-rail
● Devices shares common
resources
● Devices needs to be
managed together
ENGINEERS AND DEVICES
WORKING TOGETHER
The device PM callbacks
struct dev_pm_ops {
int (*prepare)(struct device *dev);
void (*complete)(struct device *dev);
int (*suspend)(struct device *dev);
int (*resume)(struct device *dev);
int (*freeze)(struct device *dev);
int (*thaw)(struct device *dev);
int (*poweroff)(struct device *dev);
int (*restore)(struct device *dev);
int (*suspend_late)(struct device *dev);
int (*resume_early)(struct device *dev);
int (*freeze_late)(struct device *dev);
int (*thaw_early)(struct device *dev);
int (*poweroff_late)(struct device *dev);
int (*restore_early)(struct device *dev);
int (*suspend_noirq)(struct device *dev);
int (*resume_noirq)(struct device *dev);
int (*freeze_noirq)(struct device *dev);
int (*thaw_noirq)(struct device *dev);
int (*poweroff_noirq)(struct device *dev);
int (*restore_noirq)(struct device *dev);
int (*runtime_suspend)(struct device *dev);
int (*runtime_resume)(struct device *dev);
int (*runtime_idle)(struct device *dev);
};
Sytem PM (suspend, freeze, hibernation)
Runtime PM
ENGINEERS AND DEVICES
WORKING TOGETHER
The hierarchy of device PM callbacks
struct device {
…
struct dev_pm_domain *pm_domain;
…
struct bus_type *bus
…
struct device_driver *driver
...
};
ENGINEERS
AND DEVICES
WORKING
TOGETHER
The generic PM domain 1/2
A generic solution for idle management of devices and PM
domains:
● PM domain topology and the devices - described in DT.
● Grouping of devices.
● Attach/detach of device to its PM domain.
● Sub-domains and master-domains.
● SoC specific callbacks to power on/off genpd.
● SoC specific callbacks to power on/off devices.
Genpd relies on:
● Deployment of runtime PM.
● Deployment of system PM.
ENGINEERS AND DEVICES
WORKING TOGETHER
The generic PM domain 2/2
PM domain
PM subdomain
DEV 2 DEV 3 DEV 4 DEV 5
DEV 0 DEV 1
pm_domain: power-controller@12340000 {
compatible = "foo,power-controller";
reg = <0x12340000 0x1000>;
#power-domain-cells = <1>;
};
pm_subdomain: power-controller@12341000 {
compatible = "foo,power-controller";
reg = <0x12341000 0x1000>;
power-domains = <&pm_domain 0>;
#power-domain-cells = <1>;
};
dev0@12350000 {
compatible = "foo,i-leak-current";
reg = <0x12350000 0x1000>;
power-domains = <&pm_domain 0>;
};
...
dev2@12356000 {
compatible = "bar,i-leak-current";
reg = <0x12356000 0x1000>;
power-domains = <&pm_subdomain 0>;
};
...
ENGINEERS AND DEVICES
WORKING TOGETHER
The genpd governor and dev PM QoS
Problem:
● Introduced request latency, as powering off/on a device and its PM domain,
could consume a non-neglectable time.
Solution:
● Dev PM QoS to set latency constraints, which are validated by the genpd
governor before power off a device.
● Or the runtime PM autosuspend option is sufficient!?
ENGINEERS
AND DEVICES
WORKING
TOGETHER
Deploy PM support - what methods?
An observed method. It works, but could be tricky.
1. Deploy system PM support.
2. Deploy runtime PM support.
3. Forgot to consider wake-up settings in the first steps, so
adding them on top.
4. Deploy genpd support.
A better method!
1. Deploy genpd support.
2. Deploy runtime PM and use the runtime PM centric
approach to get system PM for free. Deal with wake-up
settings.
ENGINEERS
AND DEVICES
WORKING
TOGETHER
Deploy genpd support
1. DT documentation about your PM domain(s).
2. Update DTB.
3. Implement the SoC specific parts for the PM domain(s).
4. Initialize a genpd via pm_genpd_init().
5. Register an genpd OF provider via
of_genpd_add_provider_simple|onecell().
6. Add subdomain(s) if applicable.
There are plenty of good examples!
ENGINEERS
AND DEVICES
WORKING
TOGETHER
The runtime PM centric approach 1/3
Operations to put a device into low power state,
may be very similar during system PM suspend
as runtime PM suspend and vice versa.
ENGINEERS
AND DEVICES
WORKING
TOGETHER
The runtime PM centric approach 2/3
1. Deploy runtime PM.
2. Deal with wake-ups.
Option 1)
Assign the system PM callbacks to
pm_runtime_force_suspend|resume()
Option 2:
Call pm_runtime_force_suspend|resume()
from your own system PM callbacks.
ENGINEERS
AND DEVICES
WORKING
TOGETHER
The runtime PM centric approach 3/3
mydrv.c: (Option 1)
…
static const struct dev_pm_ops mydrv_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_susp
end,
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(mydrv_ runtime_suspend,
mydrv_runtime_resume,
NULL)
};
…
ENGINEERS
AND DEVICES
WORKING
TOGETHER
Latest achievements
● Genpd: Don’t unnecessary power up devices during
system PM suspend, just to shortly after power off them
again.
->Decreases system PM suspend time and avoid wasting power.
● Genpd/Runtime PM: Don’t unnecessary power up devices
during system PM resume, just to shortly after power off
them again.
○ Last patch in series caused a regression, so it was dropped. We are
working on this.
-> Decreases system PM resume time and avoid wasting power.
● Genpd: Support to remove genpds.
ENGINEERS
AND DEVICES
WORKING
TOGETHER
Ongoing work 1/2
● Enable genpd to collect power statistics.
○ Useful when power can’t be measured.
● Runtime PM deployment in the core part of subsystems.
○ Deployed: mmc, spi, block, phy, usb, etc
○ Discussed: clock, irqchip, DMA, IOMMU etc
● Enable options to describe functional dependencies
between devices, from probing and system/runtime PM
point of view.
○ This is *not* about child-parents relationships, but more soft
dependencies between devices.
○ https://lwn.net/Articles/700930/
ENGINEERS
AND DEVICES
WORKING
TOGETHER
Ongoing work 2/2
● A unified solution to manage idle across all kind of devices,
including CPUs.
○ CPUIdle framework doesn’t scale for multi-cluster SMP systems and
heterogeneous systems like big.LITTLE.
○ We are extending runtime PM and genpd to also cover CPUs. Genpd
already provides most of the needed building blocks to deploy this
solution and we get unified solution to manage idle across all kind of
devices.
○ PMWG tree has two ARM64 SoCs being tested. We can add more!
○ Extremely easy to deploy for ARM64. DTB updates only.
○ More discussions at LPC in November.
ENGINEERS
AND DEVICES
WORKING
TOGETHER
Some interesting news
● The usage of genpd keeps increasing.
○ v3.18: 5 callers of pm_genpd_init()
○ v4.5: 14
○ v4.8: 18
● The runtime PM centric approach is being adopted.
○ v3.18: 7 users of pm_runtime_force_suspend|resume()
○ v4.5: 16
○ v4.8: 25
Thank You!
ulf.hansson@linaro.org
#LAS16
For further information: www.linaro.org
LAS16 keynotes and videos on: connect.linaro.org

Mais conteúdo relacionado

Mais de Linaro

HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 2018HPC network stack on ARM - Linaro HPC Workshop 2018
HPC network stack on ARM - Linaro HPC Workshop 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
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...Linaro
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramLinaro
 
HKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNHKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNLinaro
 
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...Linaro
 
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...Linaro
 

Mais de Linaro (20)

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
 
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
HKG18-500K1 - Keynote: Dileep Bhandarkar - Emerging Computing Trends in the D...
 
HKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready ProgramHKG18-317 - Arm Server Ready Program
HKG18-317 - Arm Server Ready Program
 
HKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NNHKG18-312 - CMSIS-NN
HKG18-312 - CMSIS-NN
 
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
HKG18-301 - Dramatically Accelerate 96Board Software via an FPGA with Integra...
 
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
HKG18-300K2 - Keynote: Tomas Evensen - All Programmable SoCs? – Platforms to ...
 

Último

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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 StrategiesBoston Institute of Analytics
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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 productivityPrincipled Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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, Adobeapidays
 
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...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Último (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

LAS16-410: Don't waste power when idle with runtime PM

  • 1. Don’t waste power when idle Ulf Hansson, Linaro, PMWG
  • 2. ENGINEERS AND DEVICES WORKING TOGETHER Agenda ● SoC idling - why, what, how? ● Overview of some PM frameworks. ● Deploy PM support - what methods? ● Deploy genpd support. ● Use the runtime PM centric approach and get system PM for free! ● Latest achievements and ongoing work. ● Some other interesting news.
  • 3. ENGINEERS AND DEVICES WORKING TOGETHER SoC idling - why, what, how? The why: ● Avoid wasting power when idle! The what: ● CPUs are important, but it’s not enough. ● Lots of resources/devices can enter low power state(s). The how: ● Solve common PM issues/corner-cases. ● Enable easy PM deployment for ARM SoCs.
  • 4. ENGINEERS AND DEVICES WORKING TOGETHER Overview of some PM frameworks ● System PM ● Runtime PM ● PM domain ● The generic PM domain (aka genpd) ● Device PM QoS
  • 5. ENGINEERS AND DEVICES WORKING TOGETHER System PM vs runtime PM ● System PM - system wide with all devices. ○ Closing the lid on your laptop. ○ Pressing the power button on your Android device. ○ Autosleep - when not prevented! ● Runtime PM - fine grained for any devices. ○ At request inactivity. ○ For unused, but enabled devices. ● Historically treated as two orthogonal PM frameworks. ○ CONFIG_PM_RUNTIME was merged into the CONFIG_PM. ○ pm_runtime_force_suspend|resume() helpers was added.
  • 6. ENGINEERS AND DEVICES WORKING TOGETHER PM Domains PM domain DEV 0 DEV 1 DEV 2 DEV 4 Power-rail ● Devices shares common resources ● Devices needs to be managed together
  • 7. ENGINEERS AND DEVICES WORKING TOGETHER The device PM callbacks struct dev_pm_ops { int (*prepare)(struct device *dev); void (*complete)(struct device *dev); int (*suspend)(struct device *dev); int (*resume)(struct device *dev); int (*freeze)(struct device *dev); int (*thaw)(struct device *dev); int (*poweroff)(struct device *dev); int (*restore)(struct device *dev); int (*suspend_late)(struct device *dev); int (*resume_early)(struct device *dev); int (*freeze_late)(struct device *dev); int (*thaw_early)(struct device *dev); int (*poweroff_late)(struct device *dev); int (*restore_early)(struct device *dev); int (*suspend_noirq)(struct device *dev); int (*resume_noirq)(struct device *dev); int (*freeze_noirq)(struct device *dev); int (*thaw_noirq)(struct device *dev); int (*poweroff_noirq)(struct device *dev); int (*restore_noirq)(struct device *dev); int (*runtime_suspend)(struct device *dev); int (*runtime_resume)(struct device *dev); int (*runtime_idle)(struct device *dev); }; Sytem PM (suspend, freeze, hibernation) Runtime PM
  • 8. ENGINEERS AND DEVICES WORKING TOGETHER The hierarchy of device PM callbacks struct device { … struct dev_pm_domain *pm_domain; … struct bus_type *bus … struct device_driver *driver ... };
  • 9. ENGINEERS AND DEVICES WORKING TOGETHER The generic PM domain 1/2 A generic solution for idle management of devices and PM domains: ● PM domain topology and the devices - described in DT. ● Grouping of devices. ● Attach/detach of device to its PM domain. ● Sub-domains and master-domains. ● SoC specific callbacks to power on/off genpd. ● SoC specific callbacks to power on/off devices. Genpd relies on: ● Deployment of runtime PM. ● Deployment of system PM.
  • 10. ENGINEERS AND DEVICES WORKING TOGETHER The generic PM domain 2/2 PM domain PM subdomain DEV 2 DEV 3 DEV 4 DEV 5 DEV 0 DEV 1 pm_domain: power-controller@12340000 { compatible = "foo,power-controller"; reg = <0x12340000 0x1000>; #power-domain-cells = <1>; }; pm_subdomain: power-controller@12341000 { compatible = "foo,power-controller"; reg = <0x12341000 0x1000>; power-domains = <&pm_domain 0>; #power-domain-cells = <1>; }; dev0@12350000 { compatible = "foo,i-leak-current"; reg = <0x12350000 0x1000>; power-domains = <&pm_domain 0>; }; ... dev2@12356000 { compatible = "bar,i-leak-current"; reg = <0x12356000 0x1000>; power-domains = <&pm_subdomain 0>; }; ...
  • 11. ENGINEERS AND DEVICES WORKING TOGETHER The genpd governor and dev PM QoS Problem: ● Introduced request latency, as powering off/on a device and its PM domain, could consume a non-neglectable time. Solution: ● Dev PM QoS to set latency constraints, which are validated by the genpd governor before power off a device. ● Or the runtime PM autosuspend option is sufficient!?
  • 12. ENGINEERS AND DEVICES WORKING TOGETHER Deploy PM support - what methods? An observed method. It works, but could be tricky. 1. Deploy system PM support. 2. Deploy runtime PM support. 3. Forgot to consider wake-up settings in the first steps, so adding them on top. 4. Deploy genpd support. A better method! 1. Deploy genpd support. 2. Deploy runtime PM and use the runtime PM centric approach to get system PM for free. Deal with wake-up settings.
  • 13. ENGINEERS AND DEVICES WORKING TOGETHER Deploy genpd support 1. DT documentation about your PM domain(s). 2. Update DTB. 3. Implement the SoC specific parts for the PM domain(s). 4. Initialize a genpd via pm_genpd_init(). 5. Register an genpd OF provider via of_genpd_add_provider_simple|onecell(). 6. Add subdomain(s) if applicable. There are plenty of good examples!
  • 14. ENGINEERS AND DEVICES WORKING TOGETHER The runtime PM centric approach 1/3 Operations to put a device into low power state, may be very similar during system PM suspend as runtime PM suspend and vice versa.
  • 15. ENGINEERS AND DEVICES WORKING TOGETHER The runtime PM centric approach 2/3 1. Deploy runtime PM. 2. Deal with wake-ups. Option 1) Assign the system PM callbacks to pm_runtime_force_suspend|resume() Option 2: Call pm_runtime_force_suspend|resume() from your own system PM callbacks.
  • 16. ENGINEERS AND DEVICES WORKING TOGETHER The runtime PM centric approach 3/3 mydrv.c: (Option 1) … static const struct dev_pm_ops mydrv_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_susp end, pm_runtime_force_resume) SET_RUNTIME_PM_OPS(mydrv_ runtime_suspend, mydrv_runtime_resume, NULL) }; …
  • 17. ENGINEERS AND DEVICES WORKING TOGETHER Latest achievements ● Genpd: Don’t unnecessary power up devices during system PM suspend, just to shortly after power off them again. ->Decreases system PM suspend time and avoid wasting power. ● Genpd/Runtime PM: Don’t unnecessary power up devices during system PM resume, just to shortly after power off them again. ○ Last patch in series caused a regression, so it was dropped. We are working on this. -> Decreases system PM resume time and avoid wasting power. ● Genpd: Support to remove genpds.
  • 18. ENGINEERS AND DEVICES WORKING TOGETHER Ongoing work 1/2 ● Enable genpd to collect power statistics. ○ Useful when power can’t be measured. ● Runtime PM deployment in the core part of subsystems. ○ Deployed: mmc, spi, block, phy, usb, etc ○ Discussed: clock, irqchip, DMA, IOMMU etc ● Enable options to describe functional dependencies between devices, from probing and system/runtime PM point of view. ○ This is *not* about child-parents relationships, but more soft dependencies between devices. ○ https://lwn.net/Articles/700930/
  • 19. ENGINEERS AND DEVICES WORKING TOGETHER Ongoing work 2/2 ● A unified solution to manage idle across all kind of devices, including CPUs. ○ CPUIdle framework doesn’t scale for multi-cluster SMP systems and heterogeneous systems like big.LITTLE. ○ We are extending runtime PM and genpd to also cover CPUs. Genpd already provides most of the needed building blocks to deploy this solution and we get unified solution to manage idle across all kind of devices. ○ PMWG tree has two ARM64 SoCs being tested. We can add more! ○ Extremely easy to deploy for ARM64. DTB updates only. ○ More discussions at LPC in November.
  • 20. ENGINEERS AND DEVICES WORKING TOGETHER Some interesting news ● The usage of genpd keeps increasing. ○ v3.18: 5 callers of pm_genpd_init() ○ v4.5: 14 ○ v4.8: 18 ● The runtime PM centric approach is being adopted. ○ v3.18: 7 users of pm_runtime_force_suspend|resume() ○ v4.5: 16 ○ v4.8: 25
  • 21. Thank You! ulf.hansson@linaro.org #LAS16 For further information: www.linaro.org LAS16 keynotes and videos on: connect.linaro.org