Linux Power Management Experiences on Moorestown

Similar documents
The Simple Firmware Interface

QoS Handling with DVFS (CPUfreq & Devfreq)

POWER-AWARE SOFTWARE ON ARM. Paul Fox

Implementing ACPI 5 Features

Embedded Linux Conference San Diego 2016

Power Management as I knew it. Jim Kardach

PyTimechart practical. Pierre Tardy Software Engineer - UMG October 2011

Power Management for Embedded Systems

POWER MANAGEMENT AND ENERGY EFFICIENCY

SoC Idling & CPU Cluster PM

OS Structure. Hardware protection & privilege levels Control transfer to and from the operating system

User s Guide. Alexandra Yates Kristen C. Accardi

The Embedded Linux Problem

How to get realistic C-states latency and residency? Vincent Guittot

User s Guide. Alexandra Yates Kristen C. Accardi

Software Development Using Full System Simulation with Freescale QorIQ Communications Processors

Spring 2017 :: CSE 506. Device Programming. Nima Honarmand

BIOS SETUP UTILITY Main Advanced H/W Monitor Boot Security Exit. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

Porting Linux to a new SoC

v02.54 (C) Copyright , American Megatrends, Inc.

cpuidle Do nothing, efficiently...

Operating Systems Design 25. Power Management. Paul Krzyzanowski

CIS c. University of Pennsylvania Zachary Goldberg. Notes

CSE 451: Operating Systems Winter I/O System. Gary Kimura

v02.54 (C) Copyright , American Megatrends, Inc.

v02.54 (C) Copyright , American Megatrends, Inc.

19: I/O Devices: Clocks, Power Management

Runtime Power Management on SuperH Mobile

BIOS SETUP UTILITY Main Advanced H/W Monitor Boot Security Exit. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

DMA safety in buffers for Linux Kernel device drivers

Configuration Request Retry Status (CRS) Handling. Sinan Kaya

HOW TO INTEGRATE NFC FRONTENDS IN LINUX

Tizen Power Management

Device I/O Programming

v02.54 (C) Copyright , American Megatrends, Inc.

ARM-KVM: Weather Report Korea Linux Forum

2-Oct-13. the world s most energy friendly microcontrollers and radios

Interrupt response times on Arduino and Raspberry Pi. Tomaž Šolc

Runtime Power Management Framework

v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY v02.54 (C) Copyright , American Megatrends, Inc.

v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY v02.54 (C) Copyright , American Megatrends, Inc.

BIOS SETUP UTILITY Main Advanced H/W Monitor Boot Security Exit. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

Intel Graphics Virtualization on KVM. Aug KVM Forum 2011 Rev. 3

BIOS SETUP UTILITY Main Smart Advanced H/W Monitor Boot Security Exit. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

Understand Linux Components

Realtek Ameba-1 Power Modes

Embedded Systems Architecture

v02.54 (C) Copyright , American Megatrends, Inc.

v02.54 (C) Copyright , American Megatrends, Inc.

Linux Plumber Conference Scheduler micro-conf

OpenMPDK and unvme User Space Device Driver for Server and Data Center

BIOS SETUP UTILITY. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

A Design for Comprehensive Kernel Instrumentation

Real Safe Times in the Jailhouse Hypervisor Unrestricted Siemens AG All rights reserved

Power Capping Linux. Len Brown, Jacob Pan, Srinivas Pandruvada

BIOS SETUP UTILITY. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

Attack Your SoC Power Challenges with Virtual Prototyping

VT Falcon (VL-EPU-2610) BIOS Setup

ELC The future of Tracing and Profiling for Power Management and Accelerators. Making Wireless. Jean Pihet v1.

So you want to write a Linux driver subsystem? Michael Turquette

BIOS SETUP UTILITY. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY v02.54 (C) Copyright , American Megatrends, Inc.

2018/04/11 00:10 1/6 NuttX Protected Build

Avigilon Control Center Virtual Matrix User Guide

Energy Efficiency in Operating Systems

CSC227: Operating Systems Fall Chapter 1 INTERRUPTS. Dr. Soha S. Zaghloul

I/O and virtualization

Operating Systems. V. Input / Output

Embedded System Architecture

Measuring the impacts of the Preempt-RT patch

Potentials and Limitations for Energy Efficiency Auto-Tuning

BIOS SETUP UTILITY Main Smart Advanced H/W Monitor Boot Security Exit. v02.54 (C) Copyright , American Megatrends, Inc.

v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY v02.54 (C) Copyright , American Megatrends, Inc.

PCI-SIG ENGINEERING CHANGE NOTICE

Moorestown Platform: Based on Lincroft SoC Designed for Next Generation Smartphones

BIOS SETUP UTILITY Main Advanced H/W Monitor Boot Security Exit. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

P4B533-X. Motherboard

v02.54 (C) Copyright , American Megatrends, Inc.

NTRDMA v0.1. An Open Source Driver for PCIe NTB and DMA. Allen Hubbe at Linux Piter 2015 NTRDMA. Messaging App. IB Verbs. dmaengine.h ntb.

Computer Architecture

Virtualization BOF. Isaku Yamahata

Knut Omang Ifi/Oracle 20 Oct, Introduction to virtualization (Virtual machines) Aspects of network virtualization:

BIOS SETUP UTILITY Main Smart Advanced H/W Monitor Boot Security Exit. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

The Serial Device Bus

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

Standardized Firmware for ARMv8 based Volume Servers

BIOS SETUP UTILITY. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

BIOS SETUP UTILITY Main Smart Advanced H/W Monitor Boot Security Exit. v02.54 (C) Copyright , American Megatrends, Inc.

Ubuntu Core Certified Hardware Coverage for Ubuntu Core 18

PCI Express System Interconnect Software Architecture for PowerQUICC TM III-based Systems

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

Computer Organization ECE514. Chapter 5 Input/Output (9hrs)

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

BIOS SETUP UTILITY. v02.54 (C) Copyright , American Megatrends, Inc. BIOS SETUP UTILITY

PCIe driver development for Exynos SoC

Operating Systems 2010/2011

Last Time. Think carefully about whether you use a heap Look carefully for stack overflow Especially when you have multiple threads

Department of Computer Science, Institute for System Architecture, Operating Systems Group. Real-Time Systems '08 / '09. Hardware.

Application Note 228

Notes based on prof. Morris's lecture on scheduling (6.824, fall'02).

Transcription:

Linux Power Management Experiences on Moorestown Kristen Accardi Len Brown Intel Open Source Technology Center Linux Plumbers Conference Sept. 8, 2011 Santa Rosa, CA

PCI on MRST Lincroft Graphics is real PCIe All Langwell PCI is emulated by PCI shim Config space is simply RAM Requires platform specific config space accessors PMCSR does nothing No #PME PCI Device Driver enumeration Not real HW, OS exposed to FW bugs

SFI Simple Firmware Interface SYST CPUS CPU0 CPU1 MMAP Range0 Range1 APIC Paddr Base FREQ P0 P1 WAKE Paddr C2 MTMR TMR0 TMR1 MRTC RTC0 OEMx XSDT MCFG DEVS Dev0 Dev1 GPIO Pin0 Pin1

SFI an 80% solution Simple Difficult for FW to get it wrong Open and Freely Available http://simplefirmware.org Upstream Linux since about 2.6.32 Extensible Vendor specific tables permitted Not Comprehensive Particularly for device enumeration

MRST Processor Performance States (P-states) Linux sfi-cpufreq cpufreq driver Consumes SFI FREQ table Linux ondemand cpufreq governor

S0i3 Active Idle System State S0 Active Power S0i3 S3 Suspend Latency S0 (C-state) latency S3 (system wide) low power

S0i3: C-state or S-state? S0i3 can be used for either/both use-cases. Android used S0i3 only for S3 (STR). MeeGo used S0i3 only as a C-state.

S0i3 as a C-state Package CPU 0 ATM-C1 0.5% ATM-C1 0.5% 5.1 ms ATM-C2 1.2% ATM-C2 1.2% 7.7 ms ATM-C4 0.6% ATM-C4 0.6% 5.4 ms ATM-C6 39.0% ATM-C6 39.0% 24.9 ms MRST-S0i3 56.6% MRST-S0i3 56.6% 70.9ms

MRST pmu driver Track all PCI D-state requests Translate PCI device to MRST Logical Subsystem Translate PCI D-States to MRST D-states Facilitate S0i3 transitions Track system-wide entry criteria Invoked by intel_idle's S0i3 entry point Upstream: arch/x86/platform/mrst/pmu.c See initial commit-id for contributors

Linux/MRST Power Mgmt. Architecture TRM: CPU1 on/offline User Kernel Xorg: screen on/off sysfs CPU online cpuidle subsystem menu governor PCI subsystem I/O Device Drivers intel_idle driver S0i3 graphics Software Hardware mrst_pmu driver Lincroft North Complex CPU GMA 600 Langwell South Complex IO Devices SCU

PCI devices -> MRST Logical Subsystems (LSS) PCI device has a driver MRST LSS is a HW clock/power domain Usually a simple 1:1 mapping Sometimes LSS shared

PCI -> MRST Device-States: Imperfect Mapping PCI D0 Lincroft D0 full on D0i1 auto clock gate D1, D2 D3hot, D3cold D0i2 hard clock gate D0i3 hard clock gate

/sys/kernel/debug/mrst_pmu 0800 dw_spi_pci LSS 10 D0i1 PCI D3hot D3hot 94 0 0 47 0 0802 i2c designware p LSS 10 D0i1 PCI D3hot D3hot 135034 0 0 67517 0 0803 i2c designware p LSS 10 D0i1 PCI D3hot D3hot 4 0 0 2 0 0804 i2c designware p LSS 10 D0i1 PCI D0 D0 3110 0 0 1554 0 0806 ehci_hcd LSS 7 D0i3 PCI D3hot D3hot 2 0 0 1 0 0807 sdhci pci LSS 1 D0i3 PCI D3hot D3hot 10 0 0 5 0 0808 sdhci pci LSS 2 D0i1 PCI D0 D0 65944 0 0 32971 0 0809 pci LSS 3 D0i3 PCI D0 D3hot 0 0 0 1 0 080A intel_sst_driver LSS 9 D0i3 PCI D3hot D3hot 8 0 0 4 0 080B mrstisp LSS 4 D0i3 PCI D3hot D3hot 2 0 0 1 0 080C pci LSS 5 D0i3 PCI D0 D3hot 0 0 0 1 0 080D pci LSS 6 D0i3 PCI D0 D3hot 0 0 0 1 0 080E intel_scu_ipc PCI D0 D0 2 0 0 0 0 4102 pvrsrvkm PCI D0 D0 14722 0 0 12661 0 0814 Intel MID DMA LSS 9 D0i3 PCI D3hot D3hot 2 0 0 1 0 0815 pci LSS 9 D0i3 PCI D0 D3hot 0 0 0 1 0 084F sdhci pci LSS 12 D0i1 PCI D0 D0 160702 0 0 80350 0

Linux Run Time Device PM 10 observations from deployment on MRST

Run Time Device PM #1 Understand the concept of runtime power management. ** you sleep when you are not busy, not when someone tells you to! ** Transparent to user space. Initiated by kernel.

Run Time Device PM #2 Know what your subsystem does for you. Review your subsystem power management code - what does it really do? For example, on PCI, the amount of setup work you have to do in the driver is limited to allowing runtime pm and then decrementing the usage count. Similarly, in the pm_runtime_suspend/resume code paths in the driver, you will not need to duplicate core functionality like sending power state transitions.

Run Time Device PM #3 Understand all the possible entry points to your driver. sysfs counts!

Run Time Device PM #4 Understand when you are actually touching hardware.

Run Time Device PM #5 Understand the context in which you are being called during these entry points. Are you called in interrupt context?

Run Time Device PM #6 For interrupt context, ensure the hardware is available without sleeping, otherwise use a workqueue.

Run Time Device PM #7 Refcounting during the irq handler does cost cycles. this may be ok depending on your device. On mrst, we had no #PME, so wakeups would come as regular interrupts. This required that we do ref counting at irq time, and that we use threaded irqs as much as possible.

Run Time Device PM #8 Have the correct granularity for your ref counting. Depending on your hw, it likely has a performance penalty for entering a suspended state. You may evenlose device state. Restoring can take time, so you want to make sure you are appropriately idle before allowing a suspend.

Run Time Device PM #9 Unbalanced ref counting occurs when you do not pay attention to error paths.

Run Time Device PM #10 Unbalanced ref counting can occur when you try to do something tricky with the refcounting to work around overly complex code paths. eg. setting your pm usage count to zero without decrementing. This will cost you hours and hours of debug time Don't do it! Clean up your driver and stop trying to hack your way out of it.

Thank you!