[Solved] High CPU utilization (100% on one core) when second monitor connected

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Racer-X-

[Solved] High CPU utilization (100% on one core) when second monitor connected

Post by Racer-X- »

This is on my little "travelling" netbook. When I'm home (not that often lately), I plug in an external 20" monitor to the VGA port on the side of this thing. It's only got a 10" screen on the netbook itself. I have it configured to use both monitors when the second monitor is plugged in so I can drag windows over onto the larger screen and see more there.

Yesterday, when I plugged in the external monitor, the machine got really slow. Nearly unusably sluggish. I unplugged the monitor and everything was good. I had a few more minutes to do some testing today. Indeed, when the external monitor is connected, the machine gets very sluggish. The CPU usage graph goes up around 50%, and the two bar graphs on the CPU Usage Graph plugin always shows one processor core pegged at 100%. I opened a terminal window and ran top, and the process that is hammering the CPU is "xfwm4." The utilization is at 100% for that process, and the top lines show it's all user process hammering on that core (not system, not wait, no other type that's broken out). Which core is pegged bounces back and forth (there are two cores on this system).

So far, I've tried booting older kernels, and it occurs with all the 5.0.0-3x kernels I have since upgrading to 19.3(Tricia). It also occurs with a couple of lingering 4.15 kernels from 19.2(Tina) that I haven't deleted yet. I don't think it's a kernel issue.

While I was travelling, I was pretty much keeping up with all the updates, and there have been a bunch of updates since I was last home and plugged in the external monitor, so figuring out exactly which package broke this is going to be difficult.

One other thing. Even though I posted this in the XFCE section, it's not specific to XFCE. This machine was initially set up with 19.2(Tina) with Cinnamon. I added the mint-meta-xfce package to get xfce sessions. Just for grins, and for another data point, I logged in changing my session to a Cinnamon session. The same high processor utilization occurs in Cinnamon, but it's not the xfwm4 process, it's a "cinnamon" process that pegs one processor at 100% under Cinnamon.

The machine is an old EeePc model 1005HAB netbook. It has been upgraded to 2GB of RAM (the maximum it will hold), and a somewhat newer, slightly faster (7200RPM, 6Gb/second transfer speed) 320GB hard drive in place of the original 5400RPM, 3Gb/second hard drive. It has the "Intel Corporation Mobile 945GSE Express Integrated Graphics Controller (rev 03)" according to the "lspci" output.

I don't expect this older netbook to be quick, but it used to work with adequate/acceptable performance, even with the second display plugged in. There's been a change with one of the recent (within the past 3 to 4 weeks) updates which changed that.

I'm not sure what other information I can provide that would help.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Racer-X-

Re: High CPU utilization (100% on one core) when second monitor connected

Post by Racer-X- »

I haven't found any resolution to this. I was thinking it could be x server related, or video driver related. I know cross posting is discouraged here, maybe an admin/moderator could move this to a more appropriate forum for that.

Here's more configuration information:

Code: Select all

$ sudo inxi -GMS
System:    Host: mint-1005HA Kernel: 5.3.0-26-generic i686 bits: 32 Desktop: Xfce 4.14.1 Distro: Linux Mint 19.3 Tricia 
Machine:   Type: Laptop System: ASUSTeK product: 1005HA v: x.x serial: ░░░░░░░░░░░░ 
           Mobo: ASUSTeK model: 1005HA v: x.xx serial: ░░░░░░░░░░░░░░░░ BIOS: American Megatrends v: 1301 date: 01/05/2010 
Graphics:  Device-1: Intel Mobile 945GSE Express Integrated Graphics driver: i915 v: kernel 
           Display: server: X.Org 1.20.5 driver: intel unloaded: fbdev,modesetting,vesa 
           resolution: 1024x600~60Hz, 1400x1050~60Hz 
           OpenGL: renderer: Mesa DRI Intel 945GME x86/MMX/SSE2 v: 1.4 Mesa 19.2.1 
That output is from the time when the system was very sluggish and had the 100% cpu load on one of the cores, and had both displays attached. The internal display is the 1024x600~60Hz display. The second (external) display is 1400x1050~60Hz.

If I can post anything else, let me know.

Another observation from some additional testing. When I plug in the second monitor in a XFCE4 session, it's the "xfwm" process that goes to 100% CPU utilization. When I plug in the second monitor in a Cinnamon session, it's the "cinnamon" process that goes to 100% CPU utilization. However, I added Mate to this system (sudo apt install mint-meta-mate) and when I plug in the second monitor in Mate, there is no issue. I really prefer XFCE, but it's interesting that the issue doesn't occur with Mate.

I'm wondering if, for testing purposes, I should install openbox and configure my XFCE to use openbox as the window manager instead of xfwm. That might give another clue as to what is going wrong. I know switching over to openbox is possible for testing. It seems like I've done that on another older machine several years ago for video/x-server issues, but I really don't remember what I have to do to reconfigure this thing to use openbox instead of xfwm.
Racer-X-

Re: High CPU utilization (100% on one core) when second monitor connected

Post by Racer-X- »

I found a workaround.

I checked on the xfce IRC chat channel, and someone called "brainwash" there pointed me at the XFCE forums (AKA "the ToZ forums"), this post: https://forum.xfce.org/viewtopic.php?id=13233

I was able to work around the high CPU utilization by switching vblank_mode from "auto" to "xpresent." I used this command:

Code: Select all

$ xfconf-query -c xfwm4 -p /general/vblank_mode -t string -s "xpresent" --create
Turning off display compositing in the "Window manager tweaks" section of the settings manager also resolved the cpu overload issue, but disabled all the nifty features that the display compositor enables, like inactive window transparency and other transparency options.
Philipp91
Level 1
Level 1
Posts: 18
Joined: Sat Mar 13, 2021 10:59 am

Re: [Solved] High CPU utilization (100% on one core) when second monitor connected

Post by Philipp91 »

I also observe 100% CPU usage on one core by the cinnamon process (haven't tried XFCE). But I think I can narrow down when this happens. I have 4 cores, so when I say 25% below, that means 100% of one core.
  • I always have the second monitor connected and there are always some windows on it (specifically, I move the System Monitor on there, so I can monitor CPU usage while doing something else on the main monitor).
  • cinnamon CPU usage is always low (median 1%, always <10%) when I do nothing with the computer and all window contents are still (e.g. no video or ad playing).
  • cinnamon CPU usage is always low when there is no Cinnamon panel on the second monitor (which is in fact the default UI configuration of Cinnamon).
  • When I add a panel to the second monitor and at least one applet to it (e.g. the clock or the main menu button), even if I remove said applet again after having added it, then when I do something to update some window's contents (no matter on which screen the window is), the cinnamon CPU usage jumps above 10%. If the window contents update frequently enough (e.g. a video with a panning camera motion, or when I scroll continuously across an otherwise unanimated website), the cinnamon CPU usage quickly reaches the maximum 25%.
  • As soon as I remove that Cinnamon panel on the second screen again, everything is back to normal.
  • And just to address one particular suspicion: On the main monitor I have a "Grouped window list" applet, but as long as any non-empty panel exists on the second monitor, the CPU usage doesn't go away even if I remove the "Grouped window list" from my main monitor or when I disable its thumbnail and peek features. So I believe the "Grouped window list" can't be blamed.
Locked

Return to “Xfce”