konkor / cpufreq

System Monitor and Power Manager
https://konkor.github.io/cpufreq/
GNU General Public License v3.0
578 stars 60 forks source link

Show frequencies instead of percentages #67

Open piegamesde opened 6 years ago

piegamesde commented 6 years ago

I hate it when any CPU frequencies are shown in percent rather than in Hz. Is it possible to add an option to show the real frequency instead of a percentage? And is it possible to snap the sliders to the next frequency scale (both in percentage and in frequency mode)?

konkor commented 6 years ago

@piegamesde the easiest way to show Hz instant of percentage is to switch to acpi driver (https://github.com/konkor/cpufreq#how-to-disable--intel-pstate-driver). intel-pstate mode is not clear/standard behavior on different kernels and hardware. Sometimes, 0% is not minimal frequency, it's like a physical zero, sometimes not. About sliders snapping I will think it over. Thanks for your report.

piegamesde commented 6 years ago

Thank for the suggestion, but why would disabling the intel_pstate driver change this behaviour? What is used internally to set the frequency? When I'm using cpupower I can set the frequency directly in Hz and it works fine, even on intel_pstate

konkor commented 6 years ago

@piegamesde the extension is using performance limits of intel_pstate driver. they have read/write integer values (0-100).

/sys/devices/system/cpu/intel_pstate/min_perf_pct
/sys/devices/system/cpu/intel_pstate/max_perf_pct

max_perf_pct: Limits the maximum P-State that will be requested by
      the driver. It states it as a percentage of the available performance. The
      available (P-State) performance may be reduced by the no_turbo
      setting described below.

min_perf_pct: Limits the minimum P-State that will be requested by
      the driver. It states it as a percentage of the max (non-turbo)
      performance level.

no_turbo: Limits the driver to selecting P-State below the turbo
      frequency range.

The extension doesn't use external utils and has own helper https://github.com/konkor/cpufreq/blob/master/cpufreqctl I will take a look at cpupower package to find out how it works there. Thanks.