• Save
Power management
Upcoming SlideShare
Loading in...5
×
 

Power management

on

  • 1,366 views

Linux Power Management

Linux Power Management

Statistics

Views

Total Views
1,366
Views on SlideShare
1,076
Embed Views
290

Actions

Likes
2
Downloads
0
Comments
0

15 Embeds 290

http://scottshulinux.blogspot.tw 163
http://scottshulinux.blogspot.com 93
http://scottshulinux.blogspot.in 6
http://scottshulinux.blogspot.kr 6
http://scottshulinux.blogspot.co.il 4
http://scottshulinux.blogspot.com.tr 3
http://scottshulinux.blogspot.se 3
http://scottshulinux.blogspot.co.uk 3
http://scottshulinux.blogspot.de 2
http://scottshulinux.blogspot.fr 2
http://scottshulinux.blogspot.ru 1
http://scottshulinux.blogspot.sg 1
http://translate.googleusercontent.com 1
http://scottshulinux.blogspot.hk 1
http://scottshulinux.blogspot.co.nz 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Power management Power management Presentation Transcript

  • Power Management Scott Shu
  • Power Modes • DFS • Halt • Doze • Sleep • Hibernate
  • Linux PM Framework • CPUIdle – Idle threads trigger sleep states (C0, C1, …) • CPUFreq – CPU Frequency scaling (CPU DFS) • CPU DVFS • CPU Hotplug • DDR DVFS • Peripheral DVFS • Suspend (save to RAM) • Hibernate (save to Disk)
  • SW-HW PM Mapping
  • CPUIdle • For UP system, support 2 idle stetes – C0: CPU WFI – C1: CPU WFI and DDR self-refresh • For SMP system, only support 1 idle state – C0: CPU WFI • CPUIdle governors – The menu governor can jump into a deeper state immediately. (C0 -> C2) – The ladder governor enters the lightest state first, and move on to the next deeper state if a sleep was long enough. (C0 -> C1 -> C2) • Driver – drivers/cpuidle/cpuidle-xxxxxx.c
  • CPUIdle Example # cat /sys/devices/system/cpu/cpu0/cpuidle/state0/desc Wait for interrupt ; Shows the description of the state # cat /sys/devices/system/cpu/cpu0/cpuidle/state0/disable 0 # cat /sys/devices/system/cpu/cpu0/cpuidle/state0/latency 1 ; Shows the wakeup latency for this state. # cat /sys/devices/system/cpu/cpu0/cpuidle/state0/name WFI ; Shows the name of the state # cat /sys/devices/system/cpu/cpu0/cpuidle/state0/power 4294967295 ; Shows the typical power consumed when CPU enters this state in mW # cat /sys/devices/system/cpu/cpu0/cpuidle/state0/time 79420040 ; Shows the amount of time spent in this idle state in usec. # cat /sys/devices/system/cpu/cpu0/cpuidle/state0/usage 14417 ; Shows the count of number of times this idle state has been entered
  • CPUFreq • CPU Frequency Scaling • CPUFreq governors – Conservative: Dynamically switch between CPU(s) available if at 75% load – Ondemand: Dynamically switch between CPU(s) available if at 95% load – Performance: Run the CPU at maximum frequency – Powersave: Run the CPU at the minimum frequency – Userspace: Run the CPU at user specified frequencies • Driver – drivers/cpufreq/xxxxxx-cpufreq.c
  • CPUFreq Example # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 800 # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq 100 # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor Userspace # echo 700 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 700 # mhz 700 MHz, 1.4286 nanosec clock
  • CPU DVFS • CPUFreq + Voltage Layer • Regulator Framework – Regulates the output power from input power • Voltage Control • Current Limiting • Switch output power ON/OFF VDD1 1100 ~ 1200 mV CPU_1V1 VDD2 1350 ~ 1500 mV DRAM_1V5 VIO 3300 mV D.3.3V_G VDDCTRL 1100 mV SOC_1V1 LDO1 1800 mV Reserved LDO2 2500 mV Reserved LDO3 1100 mV SB_1.1V LDO4 1100 mV Reserved LDO5 3300 mV SB_3.3V LDO6 3300 mV Reserved LDO7 2500 mV CHIP_2.5V LDO8 1000 ~ 3300 mV SD_IF_VDD
  • Regulator Framework • Regulator APIs struct regulator * regulator_get (struct device *dev, const char *id); regulator_put(regulator); int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); int regulator_get_voltage(struct regulator *regulator); int regulator_enable(regulator); int regulator_disable(regulator); int regulator_force_disable(regulator); int regulator_is_enabled(regulator); Reference: https://www.kernel.org/doc/htmldocs/regulator.html
  • CPU DVFS Example # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 800 # cat /sys/class/regulator/regulator.3/microvolts 1200000 ; Change CPU speed to 700 MHz # echo 700 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed # cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq 700 # cat /sys/class/regulator/regulator.3/microvolts 1187500
  • CPU Hotplug • CPU hotplug is one approach for bring up / shutdown the secondary CPU Cores • The code can be used by kernel “suspend” and “hibernate”. • From a power consumption point of view, the CPU hotplug feature might not be very useful for a SMP system.
  • CPU Hotplug Example # cat /sys/devices/system/cpu/online 0-2 # cat /sys/devices/system/cpu/offline # echo 0 > /sys/devices/system/cpu/cpu2/online [ 7732.890000] CPU2: shutdown # cat /sys/devices/system/cpu/online 0-1 # cat /sys/devices/system/cpu/offline 2 # echo 1 > /sys/devices/system/cpu/cpu2/online [ 7759.660000] CPU2: Booted secondary processor # cat /sys/devices/system/cpu/online 0-2
  • DDR DVFS
  • DevFreq • DVFS framework for non-CPU device • Clock Tree
  • Clock Tree • Clock APIs • Device • Driver – arch/arm/mach-xxxxxx/clock.c
  • Suspend
  • Hibernate
  • Example • Lightweight Suspend (DOZE Mode) # echo suspend > /sys/power/state • Suspend (SLEEP Mode) # echo mem > /sys/power/state • Hibernate (HIBERNATE Mode) # echo disk > /sys/power/state