You are not logged in.

#1 2012-03-17 17:07:03

ajaxas
Member
Registered: 2009-02-23
Posts: 65
Website

Changing sched_smt_power_savings from rc.local doesn't work

I like to set /sys/devices/system/cpu/sched_smt_power_savings to 1 on my laptop. This requires superuser privileges and sudo doesn't work. So,

sudo -s
echo 1 > /sys/devices/system/cpu/sched_smt_power_savings

I put this command into /et/rc.local to run at the boot, but it doesn't work. I tried:

sleep 10; echo 1 > /sys/devices/system/cpu/sched_smt_power_savings

- in case something overrides this setting, like KDE or whtaver, and even sleep 20, still nothing.

At the same time, running echo 7 > /sys/class/backlight/acpi_video0/brightness from /etc/rc.local works OK.

What am I doing wrong? sad

Offline

#2 2012-03-17 17:37:23

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Changing sched_smt_power_savings from rc.local doesn't work

ajaxas wrote:

This requires superuser privileges and sudo doesn't work.

Sure it does. You just have to use it properly.

$ sudo bash -c 'echo 1 >/sys/devices/system/cpu/sched_smt_power_savings'
# or...
$ echo 1 | sudo tee /sys/devices/system/cpu/sched_smt_power_savings >/dev/null

sudo applies to the command you prefix it with. It does not apply to redirections, which are setup by the shell before the command is actually invoked.

No idea why it doesn't work from rc.local. Add logging to find out why.

/etc/rc.local wrote:
set -x

exec >/run/rclocal.log 2>&1

echo 1 >/sys/devices/system/cpu/sched_smt_power_savings
cat /sys/devices/system/cpu/sched_smt_power_savings

Offline

#3 2012-03-18 04:26:38

ajaxas
Member
Registered: 2009-02-23
Posts: 65
Website

Re: Changing sched_smt_power_savings from rc.local doesn't work

@falconindy
Thanks for your reply!

falconindy wrote:

sudo applies to the command you prefix it with. It does not apply to redirections, which are setup by the shell before the command is actually invoked.

This is logical. I'm ashamed.

falconindy wrote:

No idea why it doesn't work from rc.local. Add logging to find out why.

Here we go:

[ajaxas@r2d2 ~]$ cat /run/rclocal.log 
+ echo 1
+ cat /sys/devices/system/cpu/sched_smt_power_savings
1
[ajaxas@r2d2 ~]$ cat /sys/devices/system/cpu/sched_smt_power_savings 
0

So I'd say, something else changes this after the boot (kde?). sad I didn't find anything in /etc, what could it be?..

Offline

#4 2012-03-18 11:21:29

pomhg
Member
Registered: 2010-12-17
Posts: 19

Re: Changing sched_smt_power_savings from rc.local doesn't work

ajaxas wrote:

So I'd say, something else changes this after the boot (kde?). sad I didn't find anything in /etc, what could it be?..

I guess something power-saving related does.
I use tlp for my T400,I did some setups in the rc.local as you did here.when boot completed,tlp set the settings to the default of tlp.
For example,when I plug in the AC adaptor,sched_smt_power_savings or sched_mc_power_savings is set to default '0' by tlp.

Offline

Board footer

Powered by FluxBB