On Thu, 21 Jul 2016 12:13:17 +0200
Thomas Ilsche <thomas.ilsche(a)tu-dresden.de> wrote:
Dear Powertop Team,
I have noticed that powertop changes the frequency set by the
userspace governor to the minimum available frequency.
This is caused by abstract_cpu::wiggle that touches the
{min,max}_freq. By doing so, it also narrows down the
scaling_setspeed setting within the min-max-range, but it is not
reset upon restoring max_freq. To illustrate what is happening behind
the scenes:
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_{min,max,cur}_freq
1200000
2901000
2000000
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_{governor,setspeed}
userspace
2000000
$ echo 1200000 | sudo
tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1200000
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
1200000
(Tested with Linux 4.4.0-21 Ubuntu)
Attached is a patch that resets the setspeed value if it was set to a
numeric value before the wiggle.
Please note that I don't really understand what you are trying to
achieve with the wiggle in the first place. It seems for instance
that this doesn't do anything if max_freq == min_freq.
We need to force a perf event at the beginning of the sampling
period. That's the only way the code can determine the starting
frequency. There may be other/better ways to do this. Patches, input
always welcome.
Best Regards,
Thomas Ilsche