[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#880203: After suspend&resume, cpufreq/scaling_max_freq is ignored



tags 880203 - moreinfo
thanks


Ben, thank you for the clarification.

On 31.10.2017 00:35, Ben Hutchings wrote:
Control: tag -1 moreinfo

If this system has an Intel CPU, I'm afraid this is expected behaviour.
  They no longer allow the OS to set an exact frequency, only a 'P-
state' (performance level).  The Linux cpufreq driver for these
processors (intel_pstate) translates the requested frequency into a P-
state, but the actual frequency is controlled by an embedded controller
that may choose a higher or lower value.

However, the cpufreq driver is not loaded in my case:

# lsmod | grep cpufreq
# lsmod | grep intel_pstate
#

Would loading some driver help?

Your text explains _what_ is happening, but not why the embedded controller chooses a higher frequency only upon suspend&resume and not earlier, when the root actually sets scaling_max_freq or when the machine is loaded with heavy applications (firefox + thunderbird + video player + some mathematical computation in the background + word processor + ...)

The way I understand it is that when the root writes to the file scaling_max_freq, a performance-level--setting request, let's call it R, goes to the embedded controller, which then chooses some frequency. Probably, upon suspend/resume, the controller thinks that there is more job to do (and, in general, there are some running applications before suspend which do incur work), and raises the actual frequency. Now, after suspend&resume, the kernel _could_, in addition to what it usually does, re-issue the request R to "undo" the too eager action of the embedded controller. If a user herself writes the same value 1200000 to scaling_max_freq again, nothing happens.

The current behavior might be expected from the viewpoint of the processor and of the embedded controller; I don't wish to question that. But, from the viewpoint of the user, this is extremely, overly _counterintuitive_. The user simply expects that the machine behaves the same after closing&opening the laptop lid. E.g., that if the user enjoyed noise-free Skype calls or noise-free music before, she expects noise-free Skype calls and noise-free music afterwards. The noise, in turn, depends on the fan, which depends on the produced heat, which depends on the frequency...

Unless you can show that a different kernel version reproducibly shows
different results, or you're not using an Intel CPU, I don't think
there's anything to be done here.

It's Intel. Unfortunately, I don't have another Linux kernel to test on the same machine right now.

Ben.


Here is the processor data (before suspend&resume):

$ cat /proc/cpuinfo | head -27
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
stepping        : 9
microcode       : 0x1c
cpu MHz         : 1200.024
cache size      : 6144 KB
physical id     : 0
siblings        : 8
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
bugs            :
bogomips        : 5183.16
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

After s&r, the MHz value goes up to some value, up to 2600.

Best regards,
Leon


Reply to: