
Auto-cpufreq – Automatic CPU speed and power optimizer for Linux - fooctrl
https://github.com/AdnanHodzic/auto-cpufreq
======
rwem
Seems to have some control loop deficiencies. If CPU utilization is ~50% then
it will enable turbo and utilization will fall below 50% and then it will
disable turbo again.

~~~
ZeroCool2u
It needs to have some form of hysteresis.

------
kylek
Readme mentions the performance governor, don’t most distros default to
ondemand these days?

~~~
jphalimi
Absolutely. I don’t know what this tool is about, but the README statement is
wrong; I can’t think of any distribution dumb enough to use performance
governor by default. Most Intel-based platforms use Intel-specific governors.

I developed an energy-aware DVFS controller for HPC clusters a few years back,
and there was no such thing as performance by default even on compute nodes.

~~~
bratch
Intel's own distribution defaults to the peformance governor [1] in order to
race to idle. This has been Intel's recommendation for some years.

[1]
[https://docs.01.org/clearlinux/latest/guides/maintenance/cpu...](https://docs.01.org/clearlinux/latest/guides/maintenance/cpu-
performance.html)

~~~
kylek
Interesting note that I wasn't aware of-

>> The intel_pstate driver only supports performance and powersave governors.

What happens when ondemand is used with the intel driver? (is it even
selectable?)

~~~
Aengeuad

      # echo performance | tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      performance
      # echo ondemand | tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      ondemand
      tee: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor: Invalid argument
      # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
      performance
    

The Arch Wiki suggests that both powersave and performance have dynamic
scaling, and running 'watch -p -n 0.25 grep \"cpu MHz\" /proc/cpuinfo'
indicates that both of them do, with powersave mostly sitting at 1.2GHz with
occasional increases on a handful of cores while powersave fluctuates from 2~
to 4.2GHz across all cores with minimal load.

The linked docs from Clear Linux say that power draw isn't entirely dependant
upon cpu frequency when there's no load so there's no issue with keeping it on
performance, and I'm not about to doubt Intel here, but I'd be surprised if
powersave didn't save power if only by clamping down how many resources
programs can use. Anecdotally I've noticed that the powersave governor doesn't
really work too well when doing things like running virtual machines and will
keep the frequency very low, as if the scaler is blind to the resources the VM
is using, while having it on the performance governor will pin all my cores to
a far more appropriate 4.2GHz.

------
nezirus
A question for author (if he reads HN). What's the difference between this
tool and Intel's thermald:
[https://github.com/intel/thermal_daemon](https://github.com/intel/thermal_daemon)

------
greatgib
This tool is a great idea. On recent computers your only choices are:
powersave or performance. That looks stupid compared to automatic CPU throttle
that we had before. So, similar to the author of this tool, I also waste time
to switch my computer from powersave to performance depending on my tasks and
if keeping battery is critical or no. Like when traveling without power plug.
Also, maybe I use it badly, but with cpufreq in have to manually change all
the state of all cores individually and can do a single command to change all
of them!

------
llampx
I recently installed Ubuntu 19.10 on my Thinkpad and one of the first things I
noticed was how bad battery life was. If this tool can help, it'll be a
godsend.

~~~
Twirrim

        sudo apt-get -y install laptop-mode
    

Enjoy your significantly better battery life. It tweaks a number of system
settings and cpu behaviour based on if you're hooked up to mains or not.

~~~
Tajnymag
How does laptop-mode compare to tlp? Doe it try to to the same thing or are
they compatible with each other?

~~~
viraptor
They try to do the same things in different implementations. They conflict
with each other and you shouldn't install both. Tlp seems to be the modern
default replacing laptop-mode, but I don't have details around why.

------
ncmncm
I can't find anything that even hints at what TLP is supposed to stand for. P
= power, I can guess, and L = Linux, maybe. T?

