You are not logged in.
Pages: 1
Anyone know of a way to see the actual commands to enable some of the tuneables contained in powertop? For example, what would one type to manually enable the setting corresponding to "Wireless Power Saving for interface wlan0?" I'd like to place a number of these in my /etc/rc.local.
Offline
Offline
Thanks for the suggestion, but I want to know the code for all all of the tweaks in powertop, not just that particular one ![]()
Offline
Looking quickly at the powertop 2.0 sourcecode, it's mostly hidden within C++ code to make the commands, under src/tuning/, but there's this:
./src/tuning/tuning.cpp: add_sysfs_tunable(_("Enable Audio codec power management"), "/sys/module/snd_hda_intel/parameters/power_save", "1");
./src/tuning/tuning.cpp: add_sysfs_tunable(_("Enable SATA link power management for /dev/sda"), "/sys/class/scsi_host/host0/link_power_management_policy", "min_power");
./src/tuning/tuning.cpp: add_sysfs_tunable(_("NMI watchdog should be turned off"), "/proc/sys/kernel/nmi_watchdog", "0");
./src/tuning/tuning.cpp: add_sysfs_tunable(_("Power Aware CPU scheduler"), "/sys/devices/system/cpu/sched_mc_power_savings", "1");
./src/tuning/tuning.cpp: add_sysfs_tunable(_("VM writeback timeout"), "/proc/sys/vm/dirty_writeback_centisecs", "1500");
Offline
@brebs - Thank you... this is exactly what I wanted. Pitty that it is just a subset of 5 ![]()
Offline
You can see what commands to use in the `Tuning` tab in the .html file generated by
# powertop --htmlOffline
pm-utils can enable almost all these tunables for you when on battery. I followed the tips on the pm-utils wiki page (enabling sata aplm + activating some of the scripts by making them executable), and post #10 by laloch in this thread to enable "runtime pm" https://bbs.archlinux.org/viewtopic.php?pid=860231
Powertop reports every single tunable 'good' for me when i'm on battery now
(screenshot: http://i.imgur.com/v6zq7.png). So far this is the battery life I've ever gotten in arch.
Last edited by bwat47 (2012-06-24 19:28:54)
Offline
Hi, I've added blacklisting, because my network adapter, probably due to some firmware or driver bug, doesn't "autowake" from suspend. So the script now looks like this:
#!/bin/sh
BLACKLIST=( 8086:10ea )
blacklisted() {
[[ -f "$1/device" && -f "$1/vendor" ]] || return 1
DEVICE=$(cat "$1/device")
VENDOR=$(cat "$1/vendor")
for ITEM in ${BLACKLIST[@]}; do
[[ ${VENDOR:2}:${DEVICE:2} == $ITEM ]] && return 0
done
return 1
}
device_pm() {
for DEVICE in /sys/bus/{pci,spi,i2c}/devices/*; do
[ -d "$DEVICE" ] || continue
CONTROL="$DEVICE/power/control"
[ -w "$CONTROL" ] || continue
blacklisted $DEVICE && continue
echo $1 > $CONTROL
done
}
case "$1" in
true)
echo "**device power management ON"
device_pm auto
;;
false)
echo "**device power management OFF"
device_pm on
;;
esac
exit 0Offline
Hi, I've added blacklisting, because my network adapter, probably due to some firmware or driver bug, doesn't "autowake" from suspend. So the script now looks like this:
#!/bin/sh BLACKLIST=( 8086:10ea ) blacklisted() { [[ -f "$1/device" && -f "$1/vendor" ]] || return 1 DEVICE=$(cat "$1/device") VENDOR=$(cat "$1/vendor") for ITEM in ${BLACKLIST[@]}; do [[ ${VENDOR:2}:${DEVICE:2} == $ITEM ]] && return 0 done return 1 } device_pm() { for DEVICE in /sys/bus/{pci,spi,i2c}/devices/*; do [ -d "$DEVICE" ] || continue CONTROL="$DEVICE/power/control" [ -w "$CONTROL" ] || continue blacklisted $DEVICE && continue echo $1 > $CONTROL done } case "$1" in true) echo "**device power management ON" device_pm auto ;; false) echo "**device power management OFF" device_pm on ;; esac exit 0
nice, looks like that could come in handy if i run into any similar issues. I have run into a sort of similar issue already when runtime pm is enabled, my system hangs on power off (due to a bug with ehci_hcd), I've already managed to work around that one by writing a systemd service file to rmmod it on shutdown though ![]()
Last edited by bwat47 (2012-06-26 15:47:30)
Offline
Pages: 1