You are not logged in.
I intend to add the following in /etc/default/tlp using the parameter run-on-bat for all the cores/threads except the first one:
for i in /sys/devices/system/cpu/cpu*/online; do echo 0 > $i; done
and using the parameter run-on-ac:
for i in /sys/devices/system/cpu/cpu*/online; do echo 1 > $i; done
But tlp isnt accepting these command arguments:
run_on_bat for i in /sys/devices/system/cpu/cpu*/online; do echo 0 > $i; done
RUN_ON_BAT for i in /sys/devices/system/cpu/cpu*/online; do echo 0 > $i; done
run-on-bat for i in /sys/devices/system/cpu/cpu*/online; do echo 0 > $i; done
Kindly advise.
Thanks in advance.
Last edited by makh (2017-01-28 04:13:32)
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
Hi,
what you're trying does not work for two reasons:
1. There is no parameter RUN_ON_BAT in the TLP config file. There is just the command line tool run-on-bat which is not executed automatically upon change of power source. TLP intentionally has no feature to execute user defined commands automatically.
2. run-on-bat works only with command executables but "for ..." is a shell construct that must be interpreted by a shell. You have to use something like run-on-bat sh -c "for ..." or put your commands in a script. But this won't achieve what you want because of 1.
Apart from the above obstacles i seriously doubt that statically turning off cores like this will save battery power at all. This is the reason TLP doesn't have such a feature.
Did you conduct measurements yourself?
EDIT: 3. /sys/devices/system/cpu/cpu*/online is not present in current kernels (3.19 w/ acpi-cpufreq and 4.2 w/ intel_pstate)
Last edited by linrunner (2015-09-11 16:06:43)
Offline
Thanks for your reply.
I didnt made any measurements, just saw in blogs that people turn off extra cores, so wanted to do it, thinking it may benefit.
Regarding the arch system file:
$ for r in [0123]; do echo /sys/devices/system/cpu/cpu*/online ;done
/sys/devices/system/cpu/cpu1/online /sys/devices/system/cpu/cpu2/online /sys/devices/system/cpu/cpu3/online
$ uname -r
4.1.6-1-ARCH
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
just saw in blogs that people turn off extra cores, so wanted to do it, thinking it may benefit.
Better to measure yourself ... :-)
/sys/devices/system/cpu/cpu1/online /sys/devices/system/cpu/cpu2/online /sys/devices/system/cpu/cpu3/online
You're right, i made the mistake to look in cpu0 :-(.
Offline