You are not logged in.

#1 2014-04-28 06:17:47

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Indicator-powersave & throttle

indicator-powersave is a fork of indicator-cpufreq with additional toggles for system-wide powersaving. It is not a detailed reporting tool like powertop, nor an automated manager like tlp, but a user-discretion power-management utility. It is intended to be small, simple, and highly effective.

The frontend is an indicator*:
indicator-powersave.gif
The first menu item, "System Throttle", enables or disables powersaving options system-wide, including setting hyperthreads on or off, setting the CPU governor, enabling or disabling P-State Turbo, and setting all runtime power-managment attributes. This is handy for setting low-power mode during idle or unintensive use, then setting full-power mode for latency-sensitive and high-throughput use such as audio/video production, gaming, benchmarking, etc. In combination with indicator-sensors, it is also useful for thermal management (setting "cut" can decrease both CPU and chassis temperature dramatically).

*Note: It has become exceedingly difficult (impossible?) to compile Ayatana indicators for Archlinux. As such, I have moved on to packaging throttlectl by itself.

The backend is a bash script:
/usr/bin/throttlectl

This script can be used on its own! Optional dependencies are needed for ENERGY_PERF_BIAS (x86_energy_perf_policy), HDD (hdparm), LAN (ethtool), WLAN (iw), and GPU (nvidia-settings). Settings that require restart and on/off only switches (bluetooth) are intentionally omitted. Settings for proprietary and OEM device drivers can be added if asked for (any reccomendations for AMD, ATI, ARM, etc?).

There are two configuration files:
/etc/throttle.d/performance
/etc/throttle.d/powersave

A systemd service is also included: /etc/systemd/system/throttle-cut.service
If any of your hardware does not function properly with powersaving (watch out for faulty USB dongles, old soundcards, etc), make exceptions before enabling this service.

Bonus udev rules (not installed by the package): /etc/udev/rules.d/throttle-runtime-pm.rules

For maximum effectivenes, udev can apply these settings at boot and for all newly connected devices.

::UPDATES::

  • There is a new frontend for the Pantheon DE, wingpanel-indicator-powersave, derived from wingpanel-indicator-cpufreq. This frontend much improved over the original and complements the similarly updated throttlectl. Sadly, there remains no cross-DE solution for indicators.

  • The Ayatana indicator frontend is discontinued. Sadly, GNOME, Canonical, KDE, and just about everyone else decided to develop competing SNI rather than standardize for DE interoperability.

::Notes::

  • The new indicator uses simple toggles, each representing powersaving (off) or full power (on). For "CPU Performance", that means "powersave" or "performance" governor, for "GPU Performance" (still nvidia only, btw) it means "0" and "1".

  • "System Performance" is no longer one big toggle to control them all. This sets runtime powersaving for system devices other than those that have their own toggles in the indicator. This can be a lot of devices, and may cause wingpanel to hang for a moment while throttlectl runs its course.

  • Options that simply power off devices, like bluetooth or wifi, have been deliberately excluded from throttlectl. The intent here is to keep everything on, but be able to choose to run things at full or reduced power. I may reconsider in the future, but there are already too many things controlling bluetooth's on/off state in particular.

::Special Thanks::

  • People who posted tips in this thread and got this project started.

  • tlp, powertop, cpufreq-helper, and indicator-cpufreq devs.

  • Google search; because no one is born understanding linux.

Last edited by quequotion (2023-02-24 18:37:33)

Offline

#2 2014-04-28 06:41:38

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: Indicator-powersave & throttle

you can use udev rules, sysctl.d, tmpfiles.d and/or modprobe.d to enable all of those settings. Then you wouldn't need to write any additional systemd services.
Then use a script if you need to disable some of the settings to maximize performance when needed.
or you can write systemd service that simply runs the powersaving script.

Heres what I have in /etc/udev/rules.d/powersave.rules, I think it applies most of the settings you have on the script and some extra:

# wireless powersaving
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlan*", RUN+="/usr/bin/iw dev %k set power_save on"

# SATA active link power management
ACTION=="add", SUBSYSTEM=="scsi_host", KERNEL=="host*", ATTR{link_power_management_policy}="min_power"

# various subsystems
ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto"
ACTION=="add", SUBSYSTEM=="i2c", ATTR{power/control}="auto"
ACTION=="add", SUBSYSTEM=="spi", ATTR{power/control}="auto"
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="auto"

# disable autosuspend for wireless keyboard/mouse
#ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="24ae", ATTR{idProduct}=="2000", TEST=="power/control", ATTR{power/control}="on"
# autosuspend wireless keyboard mouse after 10min
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="24ae", ATTR{idProduct}=="2000", TEST=="power/autosuspend", ATTR{power/autosuspend}="600"

# enable some power saving sattings only on battery via script
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/usr/local/bin/powersave on"
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/usr/local/bin/powersave off"

you can disable nmi watchdog via sysctl or kernel command line, and enable audio power saving either via tmpfiles or modprobe options.
It may also be a good idea to blacklist every module for devices you don't need and could draw power. Also try to enable every possible power saving option for your gfx card.

There are also some additional power saving possibilities for your HD, although they may not be best suited for desktop hard drives.

Last edited by ooo (2014-04-28 06:55:32)

Offline

#3 2014-04-28 07:10:38

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Indicator-powersave & throttle

Have you seen powertop?
I think it does most of the things you have scripted & can be enabled as a systemd .service, as outlined in  the link... wink


Jin, Jîyan, Azadî

Offline

#4 2014-04-28 07:12:27

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

ooo wrote:

you can use udev rules, sysctl.d, tmpfiles.d and/or modprobe.d to enable all of those settings. Then you wouldn't need to write any additional systemd services.

Thanks! This will be best for making sure the system starts up in low power mode (udev rules probably take effect earlier than my systemd service would). Still need to work on a way to toggle all of them on and off. Something like "systemctl start/stop runtime-pm"... Maybe I can have it toggle the powersave mode through udev?

Then use a script if you need to disable some of the settings to maximize performance when needed.
or you can write systemd service that simply runs the powersaving script.

This may be what I'm looking for.

you can disable nmi watchdog via sysctl or kernel command line

These days I compile the kernel without watchdog support, but a good idea no less.

There are also some additional power saving possibilities for your HD, although they may not be best suited for desktop hard drives.

I have four SATA II drives in a 2TB RAID:0 array... if they have powersaving options I'll give them a shot.

Also, PowerTOP HTML report:




PowerTOP report








System Information

PowerTOP Version v2.6
Kernel Version Linux version 3.13.6-2-ck
System Name ASRockZ68 Extreme4 Gen3To Be Filled By O.E.M.
CPU Information Intel(R) Core(TM) i7-2700K CPU @ 3.50GHz
OS Information Arch Linux


  • Target: 1 units/s
  • System: 845.8 wakeup/s
  • CPU: 37.8% usage
  • GPU: 0 ops/s
  • GFX: 226.6 wakeups/s
  • VFS: 0 ops/s

Top 10 Power Consumers

Usage Events/s Category Description
33.4% 332.5 Process /usr/bin/vlc --started-from-file
0.9% 189.6 Process /usr/lib/firefox/firefox
100.0% Device Audio codec hwC0D0: Realtek
0.1% 83.1 Timer tick_sched_timer
0.1% 57.6 Process compton --dbus
0.1% 56.3 Timer hrtimer_wakeup
0.9% 47.2 Process /usr/bin/pulseaudio --start
0.3% 27.2 Interrupt [6] tasklet(softirq)
0.0% 8.9 Interrupt [58] snd_hda_intel
0.1% 8.1 kWork os_execute_work_item

Processor Idle State Report

Package 0
   
   
   
C2 (pc2) 0.0%
C3 (pc3) 0.0%
C6 (pc6) 0.0%
C7 (pc7) 0.0%
Core 0
   
   
   
   
C3 (cc3) 2.4%
C6 (cc6) 61.3%
C7 (cc7) 0.0%
Core 1
   
   
   
   
C3 (cc3) 1.1%
C6 (cc6) 54.1%
C7 (cc7) 0.0%
Core 2
   
   
   
   
C3 (cc3) 2.2%
C6 (cc6) 76.9%
C7 (cc7) 0.0%
Core 3
   
   
   
   
C3 (cc3) 1.8%
C6 (cc6) 85.9%
C7 (cc7) 0.0%
  CPU 0 CPU 4
C0 active 25.1%   9.2%  
POLL 0.0% 0.0 ms 0.0% 0.0 ms
C1E-SNB 6.6% 1.1 ms 0.9% 1.3 ms
       
C3-SNB 1.6% 0.7 ms 0.2% 0.8 ms
C6-SNB 67.9% 2.0 ms 89.1% 10.5 ms
       
  CPU 1 CPU 5
C0 active 25.4%   8.1%  
POLL 0.0% 0.0 ms 0.0% 0.0 ms
C1E-SNB 9.8% 2.0 ms 3.4% 5.5 ms
       
C3-SNB 0.9% 0.6 ms 0.1% 0.5 ms
C6-SNB 59.8% 2.1 ms 88.9% 13.5 ms
       
  CPU 2 CPU 6
C0 active 15.4%   4.6%  
POLL 0.0% 0.0 ms 0.0% 0.0 ms
C1E-SNB 1.8% 1.0 ms 0.4% 1.1 ms
       
C3-SNB 0.7% 0.7 ms 0.7% 13.5 ms
C6-SNB 82.7% 4.0 ms 92.5% 20.9 ms
       
  CPU 3 CPU 7
C0 active 8.7%   2.5%  
POLL 0.0% 0.0 ms 0.0% 0.0 ms
C1E-SNB 0.8% 0.8 ms 0.2% 1.4 ms
       
C3-SNB 0.8% 1.0 ms 0.2% 8.6 ms
C6-SNB 88.2% 7.6 ms 97.8% 28.3 ms
       

Processor Frequency Report

Package 0
   
Idle 100.0%
Core 0
   
Idle 100.0%
Core 1
   
Idle 100.0%
Core 2
   
Idle 100.0%
Core 3
   
Idle 100.0%
  CPU 0 CPU 4
Actual 4.7 GHz 4.8 GHz
Idle 100.0% 100.0%
  CPU 1 CPU 5
Actual 4.8 GHz 4.8 GHz
Idle 100.0% 100.0%
  CPU 2 CPU 6
Actual 4.8 GHz 4.8 GHz
Idle 100.0% 100.0%
  CPU 3 CPU 7
Actual 4.8 GHz 4.8 GHz
Idle 100.0% 100.0%

Overview of Software Power Consumers

Usage Wakeups/s GPU ops/s Disk IO/s GFX Wakeups/s Category Description
334.2 ms/s 332.5 11.3 Process /usr/bin/vlc --started-from-file
9.4 ms/s 189.6 154.8 Process /usr/lib/firefox/firefox
0.9 ms/s 83.1 Timer tick_sched_timer
1.5 ms/s 57.6 60.3 Process compton --dbus
550.5 us/s 56.3 Timer hrtimer_wakeup
9.0 ms/s 47.2 Process /usr/bin/pulseaudio --start
3.4 ms/s 27.2 Interrupt [6] tasklet(softirq)
303.4 us/s 8.9 Interrupt [58] snd_hda_intel
643.7 us/s 8.1 kWork os_execute_work_item
24.7 us/s 5.6 Process [pt1]
12.8 ms/s 0.5 Process /usr/sbin/X :0 -auth /run/lightdm/root/:0 -nolisten tcp vt1 -novtswitch
102.4 us/s 5.5 Process /usr/bin/tor -f /etc/tor/torrc
12.9 us/s 4.9 Process [usb-storage]
72.1 us/s 2.8 Interrupt [4] block(softirq)
12.0 us/s 2.5 Process [rcu_preempt]
25.0 us/s 2.0 Process mono /usr/lib/glippy/glippy.exe
109.7 us/s 1.4 Process pantheon-files
194.3 us/s 1.4 Process /usr/lib/indicator-sound/indicator-sound-service
220.8 us/s 1.3 Process /usr/lib/gnome-settings-daemon/gnome-settings-daemon
564.6 us/s 0.7 kWork disk_events_workfn
39.9 us/s 0.8 Interrupt [16] ehci_hcd:usb3
1.7 ms/s Interrupt [64] nvidia
5.3 us/s 0.7 Timer ehci_hrtimer_func
1.2 us/s 0.7 kWork blk_delay_work
361.3 us/s 0.4 Process indicator-sensors
14.7 us/s 0.5 kWork pci_pme_list_scan
4.7 us/s 0.5 Process /usr/bin/sixad-bin 0 0 0
73.0 us/s 0.4 Process /usr/bin/python2 /usr/bin/indicator-cpufreq
5.1 us/s 0.4 Process /usr/bin/httpd -f /usr/share/gnome-user-share/dav_user_2.4.conf -C Listen 49076
62.0 us/s 0.3 Interrupt [9] RCU(softirq)
35.5 us/s 0.25 Process /usr/sbin/thermald --no-daemon --dbus-enable
5.3 us/s 0.25 Process /usr/bin/contractor
535.4 us/s Interrupt [1] timer(softirq)
7.9 us/s 0.15 0.2 Process xscreensaver -no-splash
6.5 us/s 0.20 Process slingshot-launcher --silent
89.9 us/s 0.15 Process /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
40.2 us/s 0.15 0.1 Process pantheon-terminal
5.8 us/s 0.15 Process /usr/bin/NetworkManager --no-daemon
4.9 us/s 0.15 Process openbox
147.8 us/s 0.05 Process /usr/bin/preload --foreground --verbose 1
8.4 us/s 0.10 Process [ksoftirqd/0]
2.9 us/s 0.10 Process zeitgeist-datahub
1.0 us/s 0.10 kWork push_to_pool
0.9 us/s 0.10 Process [khugepaged]
0.2 us/s 0.10 kWork neigh_periodic_work
230.8 us/s Timer intel_pstate_timer_func
222.5 us/s Process powertop --html=runtime-pm.html
21.2 us/s 0.05 Process [ksoftirqd/4]
16.0 us/s 0.05 Process [ksoftirqd/2]
142.2 us/s Interrupt [8] hrtimer(softirq)
12.9 us/s 0.05 kWork bdi_writeback_workfn
4.1 us/s 0.05 Process [jbd2/md126p2-8]
1.8 us/s 0.05 Process /usr/lib/systemd/systemd-hostnamed
1.6 us/s 0.05 Process /usr/lib/accountsservice/accounts-daemon
1.4 us/s 0.05 Process /usr/lib/indicator-datetime/indicator-datetime-service
0.8 us/s 0.05 kWork check_corruption
0.7 us/s 0.05 Process /usr/lib/GConf/gconfd-2
0.6 us/s 0.05 kWork submit_flushes
117.3 us/s Timer tg3_timer
37.1 us/s Interrupt [16] ivtv0
33.0 us/s Interrupt [56] SATA controller
30.6 us/s Timer delayed_work_timer_fn
30.0 us/s Timer process_timeout
26.3 us/s Timer nvidia_rc_timer
25.2 us/s Process [ksoftirqd/3]
20.0 us/s Process [kworker/0:2]
19.9 us/s kWork vmstat_update
17.0 us/s Process [ksoftirqd/5]
16.9 us/s Process super-wingpanel
13.3 us/s Process [ksoftirqd/6]
9.5 us/s Process [ksoftirqd/7]
8.2 us/s Process /usr/lib/bamf/bamf/bamfdaemon
6.5 us/s Process [kworker/2:3]
6.4 us/s Timer bfq_idle_slice_timer
6.3 us/s Process [ksoftirqd/1]
5.6 us/s Timer clocksource_watchdog
4.6 us/s Process [kworker/4:2]
4.5 us/s Process [kworker/3:0]
4.3 us/s Process /sbin/init
4.2 us/s Process [kworker/2:1]
4.0 us/s Process [kworker/5:1]
3.2 us/s Process [kworker/6:0]
3.0 us/s Process [kworker/7:2]
3.0 us/s Process [kworker/2:2]
2.5 us/s Process [kworker/2:4]
2.1 us/s Process plank
0.9 us/s Process [kworker/2:1H]
0.8 us/s kWork md_submit_flush_data
0.8 us/s Timer dev_watchdog
0.8 us/s Process [kworker/1:1]
0.8 us/s Timer it_real_fn
0.8 us/s Process [kworker/0:1H]
0.6 us/s Timer writeout_period
0.5 us/s Interrupt [2] net tx(softirq)
0.4 us/s Timer __prandom_timer
0.3 us/s Timer blk_rq_timed_out_timer
0.2 us/s Process [kworker/u16:0]
0.1 us/s Timer commit_timeout

Device Power Report

Usage Device Name
37.8% CPU core
37.8% CPU misc
100.0% Audio codec hwC0D0: Realtek
0.0 ops/s GPU core
100.0% Display backlight
0.0 ops/s GPU misc
100.0% PCI Device: PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
100.0% PCI Device: Internext Compression Inc iTVC16 (CX23416) Video Decoder
100.0% PCI Device: PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
100.0% PCI Device: PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
100.0% PCI Device: PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
100.0% PCI Device: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge
100.0% PCI Device: Xilinx Corporation Device 222a
100.0% USB device: EHCI Host Controller
100.0% USB device: Mass Storage Device (Generic )
100.0% USB device: F-01F (Fujitsu)
100.0% USB device: USB Receiver (Logitech)
100.0% USB device: usb-device-0a12-0001
100.0% USB device: EHCI Host Controller
100.0% Radio device: btusb
100.0% USB device: usb-device-8087-0024
100.0% USB device: usb-device-8087-0024
100.0% PCI Device: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
100.0% PCI Device: PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
100.0% PCI Device: PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
100.0% PCI Device: Intel Corporation 82801 SATA Controller [RAID mode]
100.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
100.0% PCI Device: Intel Corporation Z68 Express Chipset Family LPC Controller
100.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
100.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8
100.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7
100.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6
100.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5
100.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller
100.0% PCI Device: Broadcom Corporation NetLink BCM57781 Gigabit Ethernet PCIe
100.0% PCI Device: NVIDIA Corporation GK208 [GeForce GT 630 Rev. 2]
100.0% PCI Device: NVIDIA Corporation Device 0e0f
100.0% PCI Device: Marvell Technology Group Ltd. 88SE9120 SATA 6Gb/s Controller
100.0% PCI Device: PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
100.0% PCI Device: PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
100.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1
0.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller
0.0% USB device: PLAYSTATION(R)3 Controller (Sony)
0.0% USB device: PLAYSTATION(R)3 Controller (Sony)
0.0% USB device: PLAYSTATION(R)3 Controller (Sony)
0.0% USB device: PLAYSTATION(R)3 Controller (Sony)
0.0 pkts/s Network interface: enp12s0 (tg3)
0.0 pkts/s Network interface: enp0s26u1u2 (rndis_host)
0.0% PCI Device: Intel Corporation 2nd Generation Core Processor Family DRAM Controller
0.0% PCI Device: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller
0.0% PCI Device: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1
0.0% PCI Device: Etron Technology, Inc. EJ168 USB 3.0 Host Controller
0.0% PCI Device: Etron Technology, Inc. EJ168 USB 3.0 Host Controller
0.0% USB device: SCR3310-NTTCom USB SmartCard Reader (NTT Communications Corp.)
0.0% USB device: usb-device-0424-a700
0.0% USB device: xHCI Host Controller
0.0% USB device: xHCI Host Controller
0.0% USB device: xHCI Host Controller
0.0% USB device: USB2.0 Camera (Etron Technology, Inc.)
0.0% USB device: xHCI Host Controller

Process Device Activity

Process Device
systemd /dev/autofs
/dev/kmsg
systemd-journal /dev/kmsg
/dev/kmsg
systemd-logind /dev/input/event1
/dev/input/event2
/dev/input/event3
X /dev/dri/card0
/dev/input/event1
/dev/input/event11
/dev/input/event12
/dev/input/event13
/dev/input/event2
/dev/input/event3
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidiactl
/dev/nvidiactl
/dev/vga_arbiter
pulseaudio /dev/snd/controlC0
/dev/snd/controlC0
/dev/snd/controlC0
/dev/snd/controlC1
/dev/snd/controlC1
/dev/snd/pcmC0D1p
upowerd /dev/hidraw0
/dev/hidraw0
gvfsd-fuse /dev/fuse
gnome-settings- /dev/rfkill
python2 /dev/rfkill
compton /dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidiactl
bluetoothd /dev/rfkill
vlc /dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidia0
/dev/nvidiactl

AHCI ALPM Residency Statistics - Not supported on this macine

Untunable Software Issues

Description

Optimal Tuned Software Settings

Description
Bluetooth device interface status
VM writeback timeout
Enable SATA link power management for host3
Enable SATA link power management for host0
Enable SATA link power management for host1
Enable Audio codec power management
Enable SATA link power management for host2
Enable SATA link power management for host4
Enable SATA link power management for host5
Enable SATA link power management for host6
Enable SATA link power management for host7
Autosuspend for USB device xHCI Host Controller [usb1]
Autosuspend for USB device xHCI Host Controller [usb5]
Autosuspend for USB device EHCI Host Controller [usb3]
Autosuspend for USB device EHCI Host Controller [usb6]
Autosuspend for USB device F-01F [Fujitsu]
Autosuspend for USB device xHCI Host Controller [usb4]
Autosuspend for unknown USB device 6-1 (8087:0024)
Autosuspend for unknown USB device 3-1 (8087:0024)
Autosuspend for unknown USB device 3-1.1 (0424:a700)
Autosuspend for USB device USB2.0 Camera [Etron Technology, Inc.]
Autosuspend for USB device SCR3310-NTTCom USB SmartCard Reader [NTT Communications Corp.]
Autosuspend for USB device PLAYSTATION(R)3 Controller [Sony]
Autosuspend for USB device PLAYSTATION(R)3 Controller [Sony]
Autosuspend for USB device PLAYSTATION(R)3 Controller [Sony]
Autosuspend for USB device PLAYSTATION(R)3 Controller [Sony]
Autosuspend for unknown USB device 6-1.4 (0a12:0001)
Autosuspend for USB device xHCI Host Controller [usb2]
Autosuspend for USB device Mass Storage Device [Generic ]
Autosuspend for USB device USB Receiver [Logitech]
Runtime PM for PCI Device Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1
Runtime PM for PCI Device Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1
Runtime PM for PCI Device NVIDIA Corporation Device 0e0f
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 7
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 8
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
Runtime PM for PCI Device Intel Corporation Z68 Express Chipset Family LPC Controller
Runtime PM for PCI Device Intel Corporation 82801 SATA Controller [RAID mode]
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller
Runtime PM for PCI Device NVIDIA Corporation GK208 [GeForce GT 630 Rev. 2]
Runtime PM for PCI Device Xilinx Corporation Device 222a
Runtime PM for PCI Device Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 5
Runtime PM for PCI Device Broadcom Corporation NetLink BCM57781 Gigabit Ethernet PCIe
Runtime PM for PCI Device Internext Compression Inc iTVC16 (CX23416) Video Decoder
Runtime PM for PCI Device ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge
Runtime PM for PCI Device PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
Runtime PM for PCI Device PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
Runtime PM for PCI Device PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
Runtime PM for PCI Device PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
Runtime PM for PCI Device PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
Runtime PM for PCI Device PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
Runtime PM for PCI Device PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
Runtime PM for PCI Device PLX Technology, Inc. PEX 8608 8-lane, 8-Port PCI Express Gen 2 (5.0 GT/s) Switch
Runtime PM for PCI Device Etron Technology, Inc. EJ168 USB 3.0 Host Controller
Runtime PM for PCI Device Etron Technology, Inc. EJ168 USB 3.0 Host Controller
Runtime PM for PCI Device Marvell Technology Group Ltd. 88SE9120 SATA 6Gb/s Controller
Runtime PM for PCI Device Intel Corporation 2nd Generation Core Processor Family DRAM Controller
Wake-on-lan status for device enp0s26u1u2
Wake-on-lan status for device enp12s0

I was actually trying to get Powertop to output the commands needed to enable extra powersave options, but that doesn't seem to happen.

Offline

#5 2014-04-28 07:44:48

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

Head_on_a_Stick wrote:

Have you seen powertop?
I think it does most of the things you have scripted & can be enabled as a systemd .service, as outlined in  the link... wink

Done, in combination with the udev rules above. I wonder if it's not too hard to write similar udev rules for the sound modules:

	# Runtime power-management for digital audio
	for i in /sys/module/snd_*/parameters/power_save
	do
		echo 0 > ${i} &
	done

To be revised ala:

ACTION=="add", SUBSYSTEM=="snd_*",  TEST=="parameters/power_save", ATTR{parameters/power_save}="0"

Does that look sane?

Offline

#6 2014-04-28 14:35:32

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Indicator-powersave & throttle

If you have an intel sound card create a /etc/modprobe.d/audio_powersave.conf file:

options snd_hda_intel power_save=1

As outlined here wink


Jin, Jîyan, Azadî

Offline

#7 2014-04-28 14:39:42

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: Indicator-powersave & throttle

Not sure, I'm not an expert with udev rules tbh, but somehow that doesn't seem right to me.
It would probably be simpler to use the modprobe.d method from the wiki

edit. oh man you beat me to it

Last edited by ooo (2014-04-28 14:40:43)

Offline

#8 2014-04-29 00:55:40

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

Head_on_a_Stick wrote:

If you have an intel sound card create a /etc/modprobe.d/audio_powersave.conf file:

options snd_hda_intel power_save=1

As outlined here wink

Already done wink I've already employed most of the wiki's recommendations. I also put in the udev rules, which appear to be working (need to look closely over the logs), and powertop systemd service (effective, but overkill; would rather replace with a script that runs just the needed commands).

Last edited by quequotion (2014-12-28 09:06:22)

Offline

#9 2014-04-29 01:10:40

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

EDIT: I'll have some new powersaving reports soon; the previous ones are irrelevant.

Last edited by quequotion (2014-05-12 14:40:42)

Offline

#10 2014-05-11 03:40:55

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

Progress!

There may be a few more optimizations out there and I'm open to suggestions. My intention is for the system to boot with all possible (automatic) power saving policies in place. An exception is the cpu governor, which gets set to powersave after boot anyway and is better off in performance during boot (so I'm not doing anything about that). I'm also leaving backlight out of it, which isn't effective on my system anyway, because I'd never be able to decide on an appropriately low but not too low setting and when I do use a laptop I set the brightness up and down for reasons that have nothing to do with performance or power saving (sunlight, watching movies, etc) using some software tool. Another one I'm not going to bother with is bluetooth because the only options seems to be on or off; I'm not adding little switches for each device and it's ridiculous to turn everything on full power just to get bluetooth functionality (on it stays). The wiki has strong warnings about pcie_aspm so I'll leave that alone too.

I made a few changes to the udev rules ooo suggested. These are effective across several extra subsystems, with some overlap to more specific rules already in place in Arch. USB autosuspend may be problematic, particularly with older devices.
/etc/udev/rules.d/runtime-pm.rules

See first post for latest release

EDIT: Setting USB autosuspend to 0 in udev proved unsafe; 1 seems fine. Setting autosuspend_delay_ms to 1 in udev also proved to be a bad idea; dropping that. Setting either by script seems fine.
EDIT: USB autosuspend{,_delay_ms} are not dangerous on their own; specific devices have poor implementation that may leave them disabled or behaving badly.
EDIT: Not sure if changing LED brightness actually works; the udev rule works but the LED looks the same; only have one (very cheap) device with to test this with.
EDIT: Wireless powersaving depends on an external tool, iw. Also, adjusted for being agnostic of running before or after devices get renamed (looks like Arch keeps "wl" at least).
EDIT: Same story for ethernet wake-on-lan (sort of); some devices may respond to setting the power/wakeup parameter, but most need to be set by ethtool. Again, agnostic for device renaming.

I wrote a script to handle the switch:
/usr/bin/throttle

See first post for latest release

EDIT: Reconsidering the cpu governor; in fact I usually handle this with indicator-cpufreq and I like the idea of having everything except the cpu running on minimal power for certain tasks.
EDIT: More informative output for check and massively multi-threaded setting application.

Last edited by quequotion (2015-02-22 18:24:51)

Offline

#11 2014-05-11 05:32:34

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Indicator-powersave & throttle

quequotion wrote:

The only other exception is the cpu governor, which gets set to powersave after boot anyway.

This probably isn't actually ideal for power savings actually.

See here for an explanation.

Offline

#12 2014-05-11 06:50:37

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

WonderWoofy wrote:

This probably isn't actually ideal for power savings actually.

See here for an explanation.

What sets the cpu to powersave after boot anyway? (this is not me nor any of my scripts or settings, it is the default policy)

I wonder if this article is still relevant with the Intel P-states drivers. Is the new powersave (which is scalable) any better than the old powersave (that used to lock the cpu to the minimal frequency)?

Last edited by quequotion (2014-05-11 06:54:19)

Offline

#13 2014-05-11 15:36:53

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Indicator-powersave & throttle

If the Intel P-state driver is in use then the situation is entirely different.  So you can ignore my link above.

Offline

#14 2014-05-11 16:45:05

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

WonderWoofy wrote:

If the Intel P-state driver is in use then the situation is entirely different.  So you can ignore my link above.

It seems this has been default for arch since some time before I joined, but in fact I was using it with custom kernels even before I saw the light smile

Offline

#15 2014-05-11 19:06:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Indicator-powersave & throttle

It only applies to Sandy Bridge and newer Intel processors though.  So for many users, there is still a good chance that they are using ondemand.

Offline

#16 2014-05-11 21:07:53

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: Indicator-powersave & throttle

@quequotion

I am wondering why you do not make any use of TLP which already provides a lot of your intended functionality?

Offline

#17 2014-05-12 04:46:44

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

WonderWoofy wrote:

It only applies to Sandy Bridge and newer Intel processors though.  So for many users, there is still a good chance that they are using ondemand.

Unfortunately true...

Offline

#18 2014-05-12 05:36:41

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

orschiro wrote:

@quequotion

I am wondering why you do not make any use of TLP which already provides a lot of your intended functionality?

Mostly because I didn't know about it and anyway I'd rather do this with built-in functionality than rely on tools that may or may not do precisely what I expect. I even removed the powertop systemd service! That said, it's obviously more comprehensive and I'm looking through the code now to see if there's anything I can borrow (anything that can be applied to systems generally, doesn't overtly risk data loss, and preferably can be done with module or device configuration and without additional software tools).

Since I use a desktop, the automatic switching between battery and AC  modes is unnecessary. I need a switch that's effective for going full throttle during intensive system load (by switching everything on) and cutting back at idle (with automatic settings that allow things to power up as needed). I've not yet automated this since I don't know what method of monitoring the system load would be least obtrusive and a manual switch serves this purpose fairly well (though it could use a more switch-like interface, ala indicator-cpufreq).

I'd rather not reinvent the wheel actually, but it seems like my objective is a bit different.

Last edited by quequotion (2014-05-12 05:40:36)

Offline

#19 2014-05-12 06:15:18

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Indicator-powersave & throttle

Honestly, I have just about everything set into "low" power mode (my wifi is shitty with it on) and things work just fine.  At first, like most people, I tried to make things switch depending on my AC state.  But after I while I realized that I just didn't really need to have it switch at all.  The most CPU intensive thing I do is compile things, so I guess there would probably be some use cases where having things switch might make sense.  But just not for me.  Maybe you should try just running with everything in powertop reported as "good" and see if things are okay.

As far as your particular desire for switching upon load, that is kind of a tricky thing.  The CPU portion of things is actually already taken care of by the governor (that is what it is for after all).  But then the other things like SATA link power management and PCI runtime power management... I don't even know how you would poll for load in those areas.  You would almost certainly have to write something to do that, and would thus end up running a process all the time that is essentially just keeping your CPU from idling.

Oh and BTW, I have a Thinkpad E430 with an Intel i5 3210M.  That with all the powersaving stuffs in place cause me no issues.

Offline

#20 2014-05-12 07:30:55

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

WonderWoofy wrote:

I don't even know how you would poll for load in those areas.  You would almost certainly have to write something to do that, and would thus end up running a process all the time that is essentially just keeping your CPU from idling.

Yeah, that's a problem. No clue where to start on that myself.

For now I'm focusing on starting up with the lowest power settings and having a switch to turn everything all the way on when needed, which I'll have to determine by myself for the time being.

EDIT: Had an idea: A manual switch seems more and more like the best way to go here. I have in mind forking indicator-cpufreq in one of two ways: plug this into the existing indicator or create a separate indicator. Either way, I think I'll leave the cpu governor up to the original tool and make a secondary switch for devices & subsystems.

Mockup of option A (excuse the jumbled look of this, just sort of slapped it together):
throttle_indicator.jpg

I know there are a ton of things that provide similar functionality; but then this has a specific focus: provide simple switches to comprehensively manage power at the user's discretion. At most the could be two switches: CPU, Devices with two options each: full power or powersave.

EDIT: Actually I don't think I could ever make up my mind what an appropriately low but not too low setting would be for backlight powersaving, so I'll not bother with that.

Last edited by quequotion (2014-05-12 14:45:15)

Offline

#21 2014-05-12 18:29:54

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

These are the kind of risky settings I'm nervous about including, although they do offer substantial power savings or performance optimization:

Power saving:

# echo 5 > /proc/sys/vm/laptop_mode # Known to risk data loss, often suggested
# echo 1500 > /proc/sys/vm/dirty_writeback_centisecs # Known to risk data loss, often suggested
# hdparm -B 1 -S 12 -M 128 /dev/[hs]d[a-z] # Known to reduce drive lifespan
# -B 1 = most aggressive APM (known to reduce drive lifespan); -S 12 = idle 1min to spindown (5*12=60sec) (known to reduce drive lifespan); -M 128 = Most quiet operation

Performance:

# echo 0 > /proc/sys/vm/laptop_mode # Default / Performance
# echo 500 > /proc/sys/vm/dirty_writeback_centisecs # Default / Lower numbers may reduce drive lifespan and decrease throughput
# hdparm -B 255 -S 240 -M 254 /dev/[hs]d[a-z] # Performance / -S may be ineffective with -B 255 / There is no default or means to revert -S?.
# -B 255 = no APM (Performance / Default?); -S 240 = idle 20min to spindown (5*240=1200sec) (for lack of known default); -M 254 = Fastest operation / Default?

Any thoughts? Are any of these worth the risk?
EDIT: Got a little more info from hdparm... the range for -M is 128-254, and although the man page says "most modern harddisk drives" support it, Wikipedia points out that "AAM is no longer available for Seagate and Western Digital drives". There's no information regarding a possible default setting for -S anywhere, but the man page does say it's "VERY DANGEROUS" which is too bad because it might save a lot of power if it were safe to use (and didn't reduce drive lifespan by years)...

Last edited by quequotion (2014-05-14 03:51:12)

Offline

#22 2014-05-12 20:02:08

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: Indicator-powersave & throttle

afaik hdparm -B should already spin down your drive with values below 128, at least with most laptops where HDDs should sustain more spindowns than desktop HDDs. So you could just omit the -S setting.
I'm not sure if acoustic management or -M would save much power really, as it is designed to reduce disk noise, not power consumption.

The sysctl setting may cause the loss of several seconds of work if your system freezes or loses power. You should value yourself if some power saving is worth the risk.

Offline

#23 2014-05-14 02:07:49

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

off topic: why are hdparm's options so weird anyway?

Offline

#24 2014-05-14 03:10:35

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Indicator-powersave & throttle

quequotion wrote:

off topic: why are hdparm's options so weird anyway?

Because it is simply allowing you to change vendor specific options.  Some of them are standardized and others are just a given manufacturer's specific custom quirks.

Offline

#25 2014-05-14 03:49:20

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 814
Website

Re: Indicator-powersave & throttle

ooo wrote:

afaik hdparm -B should already spin down your drive with values below 128, at least with most laptops where HDDs should sustain more spindowns than desktop HDDs. So you could just omit the -S setting.
I'm not sure if acoustic management or -M would save much power really, as it is designed to reduce disk noise, not power consumption.

The sysctl setting may cause the loss of several seconds of work if your system freezes or loses power. You should value yourself if some power saving is worth the risk.

I haven't found any documentation that clarifies exactly how long it will take for the drive to spin down with any given value of -B, but -S can allow the drive to spin down much earlier than that. The good side of that is getting down to the lowest power idle as fast as possible; the drawbacks are more cases of delayed response due to spinning up and marked increase in wear and tear due to more frequent spin down/up cycles. In fact, I'll bet it actually wastes power if the disk is going in and out of idle too often. As for -M, it reduces noise by running the drive (heads?) at a lower speed, which should require less power; how much less is another mystery.

Last edited by quequotion (2014-05-14 13:33:48)

Offline

Board footer

Powered by FluxBB