SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Mehr von 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
 

Mehr von 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 ...
 

Kürzlich hochgeladen

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Kürzlich hochgeladen (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

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