ospm 2018-04 cpu cluster idlingretis.sssup.it/luca/ospm-summit/2018/downloads/cpu... · 2018. 5....

12
OSPM 2018-04 CPU Cluster Idling Ulf Hansson, Linaro

Upload: others

Post on 05-Sep-2020

9 views

Category:

Documents


0 download

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

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

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

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

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

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

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

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

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

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

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

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

Thank You!OSMP 2018-04Ulf Hansson, Linaro