Reply to topic

Hardware sensors are randomly freezing

User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
I'm experiencing a bizarre problem since upgrading my motherboard. At random times, the hardware sensors appear to freeze and no longer deliver updates for several seconds at a time. I can see this in KSysGuard where I have a tab with a few charts showing CPU and GPU temperatures updated every second: Every now and then, the updates simply stop and the charts freeze in place. If I go to the default Process Table tab I still see activity there, but everything else (including the System Load tab, with CPU and RAM / SWAP history) stops. Switching between tabs or restarting the system monitor doesn't solve it. But if I wait somewhere over 10 seconds, they start working again. This never happened before and began with my upgrade.

The problem seems to be specific to KDE and not a high level sensor issue: I ran "watch -n1 sensors" in a console next to KSysGuard. When the system monitor froze, this command still continued to output updated temperatures without any lag.
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
Here's a screenshot showing the oddity of the issue: I quickly restarted KSysGuard upon noticing the issue, then went to the System Load tab. Upon doing that I found not only the charts frozen, but the values didn't load at all and showed nothing (not even 0). I had to wait for roughly 5 seconds before it unfroze and the numbers appeared.

What's even worse is that if I shut down KSysGuard while this is happening, the CPU History tab is permanently cleared and no cores ever appear in it any more. I have to go to ~/.local/share/ksysguard/ and delete the file SystemLoad2.sgrd to make the system monitor generate a new one in which case the entries return.

Image
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
I just noticed one more thing: This also affects the system monitor widgets placed on the desktop. Ever since this issue started, I've been noticing that plasmoids such as CPU Load Monitor, Memory Status, Hard Disk Space Usage, Hard Disk IO Monitor, Network Monitor show fixed and incorrect values for several seconds at a time. For instance: The network monitor may say that I'm downloading at precisely 50 KB/s for 5 seconds in a row, although I'm clearly transferring nothing during this time... exact same thing with HDD I/O usage. For the first few days I thought some program started networking or using the HDD in an unusual way; It just now clicked that this is the same problem, after I noticed two different system monitors freezing and unfreezing this way at the exact same time.

Image
User avatar Mamarok
Manager
Posts
3908
Karma
11
OS
Would be helpful to know which exact Plasma version you are using.

Also, what is your upgrade interval in the tabs?


Mamarok, hanging out in the Amarok forum since August, 2007
Currently running Kubuntu 19.10, Plasma 5.17.3, Frameworks 5.64.0, Qt 5.12.4, kernel 5.3.0-23
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
Mamarok wrote:Would be helpful to know which exact Plasma version you are using.

Also, what is your upgrade interval in the tabs?


Plasma 5.17.1 (now 5.17.2). Kernel 5.3.7. openSUSE Tumbleweed x64 (updated to the latest snapshot daily).

All my system monitors are set to a 1 second update interval.
User avatar Mamarok
Manager
Posts
3908
Karma
11
OS
it might be due to the specific System Monitor add-on you use, I use the one provided by the author apachelogger and see no freeze at all. Maybe try another one from the download option.


Mamarok, hanging out in the Amarok forum since August, 2007
Currently running Kubuntu 19.10, Plasma 5.17.3, Frameworks 5.64.0, Qt 5.12.4, kernel 5.3.0-23
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
Mamarok wrote:it might be due to the specific System Monitor add-on you use, I use the one provided by the author apachelogger and see no freeze at all. Maybe try another one from the download option.


I'm using the official ones that come with Plasma, in the case of openSUSE the plasma-addons package.
User avatar Mamarok
Manager
Posts
3908
Karma
11
OS
Weird, I can't reproduce any of this. Could it be a hardware issue?


Mamarok, hanging out in the Amarok forum since August, 2007
Currently running Kubuntu 19.10, Plasma 5.17.3, Frameworks 5.64.0, Qt 5.12.4, kernel 5.3.0-23
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
Mamarok wrote:Weird, I can't reproduce any of this. Could it be a hardware issue?


Could be firmware / driver specific, it started happening after I upgraded my motherboard. That's all I know however, no idea what's doing it or why yet.
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
I just discovered another important clue related to this issue. It's not just the sensors that are freezing: Other processes are too. I've been noticing this since I switched motherboards, but was convinced it was an entirely unrelated problem. I just now spotted that new applications will not start up while the sensors are frozen, but will start the moment they unfreeze.

Some practical examples: If I open a new tab in Firefox which requires opening a new Web process, Firefox will freeze during the 5 second period that sensors don't update. Or if I write "sudo zypper dup" in the console to do an update, my cursor moves to the next line when pressing enter, but nothing happens if the sensors are frozen at that time... the line asking me to input my password appears the moment they unfreeze. It also appears I can't close certain applications during a freeze: If I try closing Dolphin in such a moment, the window becomes gray and I'm asked if I want to terminate the unresponsive process... however it disappears and Dolphin closes normally at unfreeze.

So it seems something is blocking both the hardware sensors and some processes starting up or shutting down, though it seems not to affect processes that are already running. What could cause such strange behavior? Traditionally those things used to happen due to the disk I/O scheduler causing processes to go into disk sleep mode, but nothing seems to be using the hard drive while the problem occurs nor does KSysGuard show affected processes as being in "disk sleep". I already disabled SWAP with "swapoff -a" and it's not related to it.
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
I wonder if this might be related to a Ryzen specific issue I managed to find in search. Several threads suggest it might have something to do with the CPU going into idle power mode:

https://community.amd.com/thread/244175
https://bbs.archlinux.org/viewtopic.php?id=245608
https://forum.manjaro.org/t/amd-ryzen-p ... ixes/55533
https://forum.level1techs.com/t/random- ... -vm/138913

They suggest trying a few Kernel parameters, as well as changing some settings in the UEFI. If no other ideas come up I might do that and see if it changes anything.

Code: Select all
idle=nomwait processor.max_cstate=5 rcu_nocbs=0-11
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
Turns out this might be related to disk sleeping after all: If I run "sudo zypper dup" in the console then look at zypper in KSysGuard, the sudo process does say "disk sleep" during the duration of the freeze.

Image

My bet now is that the new motherboard is causing a new process to be spawned which is freezing the drive for other processes. Or could it be a disk scheduler bug? I seem to be running the proper BFQ scheduler just in case this matters.

Code: Select all
[email protected]:~> cat /sys/block/sdb/queue/scheduler
mq-deadline kyber [bfq] none
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
I seem to be onto something! When sorting by process status in htop, I see a load of processes going into "disk sleep" mode during those freezes. Those shown with the red D are included:

https://i.imgur.com/qdA3StI.png

Question now is what's triggering it. Nothing appears to be causing unusual drive I/O... that's is why I didn't suspect this in the first place, even though I knew the behavior is associated with the drive scheduler.
User avatar MirceaKitsune
Registered Member
Posts
282
Karma
0
OS
After some more testing I have finally found the culprit: The freezes are being caused by the Network Manager and / or the WPA supplicant process. They are the first to go into disk sleep each freeze as shown by htop, dragging other processed down with them in the next second. Further more, clicking the NetworkManager icon in the system tray to list my connections often triggers such a freeze on the spot before the panel shows, identical to the one occurring automatically every minute!

Looking at /var/log/wpa_supplicant.log I'm seeing one message being constantly logged there (every few minutes). Not sure if it's related to the freeze but just in case:

Code: Select all
1573327565.215899: wlan0: Reject scan trigger since one is already pending


I can confirm that disabling Wifi causes the problem to finally go away, a workaround I'll stick to for now as I don't currently need wireless internet on my desktop. This likely has something having to do with the Network Manager service.

 
Reply to topic

Bookmarks



Who is online

Registered users: alvesvaren, Baidu [Spider], Bing [Bot], Google [Bot], hsnnsnc, hussamaltayeb, kakosf, Majestic-12 [Bot], Sogou [Bot]