ospm 2018-04 cpu cluster idlingretis.sssup.it/luca/ospm-summit/2018/downloads/cpu... · 2018. 5....
TRANSCRIPT
![Page 1: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/1.jpg)
OSPM 2018-04
CPU Cluster IdlingUlf Hansson, Linaro
![Page 2: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/2.jpg)
CPU Cluster Idling● Recap● Status update● Overview of current solution● Limitations● Open topics
![Page 3: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/3.jpg)
Recap
CPU CPU
CPUCPUCache
PM Domain
CPU CPU
CPUCPU
Cache
PM Domain
Coherency
PM Domain
CacheCoreSight
CPUIdle manages CPUs well, but does not scale for multi-cluster SMP systems and heterogeneous systems like big.LITTLE.
![Page 4: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/4.jpg)
Status update● New version(s) have been posted.
○ https://lwn.net/Articles/751650/ (v7)○ git.linaro.org/people/ulf.hansson/linux-pm.git next
● Validated on 410c using ftrace and via collecting idle statistics.● Real power measurements
○ Dragonboard 410c - quad core, one cluster.○ Dragonboard 820c - quad core, two clusters○ Updates only needed to DTS.
![Page 5: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/5.jpg)
Overview
CPUIDLECPUIDLE
CPU
CPU
CPU PM->Runtime
PM
GENPD(CPUS)
CPUIDLECPUIDLE
CPUIDLECPUIDLE
CPUIDLECPUIDLE
PSCIPM
domain
GENPDCPU
GOVERNOR
CPUCLUSTER & COHERENCY
!WFI
!WFI
![Page 6: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/6.jpg)
InitializationStep 1:● PSCI driver detects OSI mode support in FW.
Step 2:● ARM64 request PSCI to init the CPU PM domain topology.● PSCI enables the OSI mode.
Step 3:● DT CPUIdle init -> PSCI DT idle init: Attach CPU to its PM domain.
![Page 7: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/7.jpg)
Enter/exit idleEnter:● CPUIdle gov: Select an idlestate for the CPU.● cpuidle-arm: cpu_pm_enter() -> pm_runtime_put_sync().
○ genpd: ->runtime_suspend() the CPU device.○ genpd: ->power_off() the CPU’s PM domain.○ genpd: ->power_off() the CPU’s master PM domain (cluster).○ genpd: CPU gov: Selects an idlestate for the master PM domain.○ PSCI PM domain: Stores idlestate data in a per CPU variable.
● cpuidle-arm: psci_cpu_suspend_enter().Exit:● cpuidle-arm: cpu_pm_exit() -> pm_runtime_get_sync().● ...
![Page 8: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/8.jpg)
CPU hotplugAllow genpd to power of the CPU’s master PM domain:
● CPU offline: PSCI detach the CPU from its PM domain.● CPU online: PSCI re-attach the CPU to its PM domain.
![Page 9: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/9.jpg)
Questions?
Zzzzzzzzzz……
![Page 10: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/10.jpg)
Limitations● genpd: CPU gov ->tick_nohz_get_next_wakeup(cpu)
{struct clock_event_device *dev = per_cpu(tick_cpu_device.evtdev, cpu);return dev->next_event;
}
● CPUs with > 1 idle states (excluded WFI)○ genpd: CPU gov: Don’t select/knows the idlestate for the CPU.
![Page 11: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/11.jpg)
Open topics● CPUIdle governor
○ genpd: CPU gov: Let it select the idlestate of the CPU as well?○ Sharing functions for heuristics for next wakeup prediction, etc.○ Play with irq-prediction.
● Caches/interconnects/irqchips/etc sharing cluster PM domain.○ Regular devices managed by runtime PM - ok!○ “Passive” runtime PM devices -> parent/child/device-links/”master”-domains or what?○ cpu_pm notifiers - striving to replace them!?
● EAS related:○ Dev PM QoS constraints for CPUs, should we care?○ Other?
![Page 12: OSPM 2018-04 CPU Cluster Idlingretis.sssup.it/luca/ospm-summit/2018/Downloads/CPU... · 2018. 5. 3. · Validated on 410c using ftrace and via collecting idle statistics. Real power](https://reader036.vdocuments.net/reader036/viewer/2022062508/5fe745144bdc0d7e035a4fa3/html5/thumbnails/12.jpg)
Thank You!OSMP 2018-04Ulf Hansson, Linaro