Bug 382561

Summary: System Monitor + kernel 4.13 = Shows the wrong processor frequency
Product: [Unmaintained] ksysguard Reporter: rооt <cerebellum>
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: cerebellum, gtwilliams, mercuriete
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot with incorrect frequency

Description rооt 2017-07-21 07:49:52 UTC
Created attachment 106774 [details]
Screenshot with incorrect frequency

I updated the kernel and noticed that the frequency shown is incorrect.
The reason may be this https://www.phoronix.com/scan.php?page=news_item&px=Linux-4.13-Power-Management

"- x86 systems will no longer try to export their current CPU frequency to /proc/cpuinfo. There's also a way to rework how the CPU frequency is exported via sysfs too, using the registers for computing the current frequency rather than relying upon the CPUFreq driver. "
Comment 1 mercuriete 2017-09-20 21:27:30 UTC
I can confirm this issue.

ksysguard shows my cpu at highest frequency all the time.

uname -a
Linux localhost.localdomain 4.13.2-gentoo #2 SMP PREEMPT Wed Sep 20 20:40:20 CEST 2017 x86_64 Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz GenuineIntel GNU/Linux


I used to see ksysguard to figure out if schedutil was working properly or not.

now the only alternative is:

sudo watch cpupower monitor

Thanks in advance.
Comment 2 Fabian Vogt 2017-10-06 12:47:57 UTC
Git commit cbaaf5f4ff54e20cb8ec782737e04d540085e6af by Fabian Vogt.
Committed on 06/10/2017 at 12:47.
Pushed by fvogt into branch 'Plasma/5.8'.

Try to read CPU clock from cpufreq/scaling_cur_freq instead of /proc/cpuinfo

Summary:
>From kernel 4.13 on, /proc/cpuinfo always reports the static normative
CPU clock and not the current one. So try to read the frequency from
cpufreq and only fall back to cpuinfo it that fails.

Test Plan:
Started ksysguard, frequency now changes. If the file is not
readable, the frequency is read from cpuinfo as expected.

Reviewers: #plasma, sebas

Reviewed By: #plasma, sebas

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8153

M  +21   -1    ksysguardd/Linux/cpuinfo.c

https://commits.kde.org/ksysguard/cbaaf5f4ff54e20cb8ec782737e04d540085e6af
Comment 3 mercuriete 2017-10-20 23:05:25 UTC
Thank you very much!

:)
Comment 4 Christoph Feck 2017-10-25 20:06:02 UTC
*** Bug 386180 has been marked as a duplicate of this bug. ***