Ubuntu 21.04 Lagging (particularly touchpad) after a decent amount of uptime?

I’ve had this happen a couple times now: after the machine has been up for a while, and slept (or at least had the lid closed) and woken several times, it eventually becomes very laggy to use. This is most noticeable when scrolling the touchpad: lots of events are just dropped and will get missed or take a while to happen.

When this is going on, system logs like this appear:

Sep 21 23:17:07 gnome-shell[412633]: libinput error: event8  - PIXA3854:00 093A:0274 Touchpad: client bug: event processing lagging behind by 17ms, your system is too slow
Sep 21 23:17:25 gnome-shell[412633]: libinput error: event8  - PIXA3854:00 093A:0274 Touchpad: client bug: event processing lagging behind by 20ms, your system is too slow
Sep 21 23:19:14 gnome-shell[412633]: libinput error: event2  - AT Translated Set 2 keyboard: client bug: event processing lagging behind by 155ms, your system is too slow
Sep 21 23:19:26 gnome-shell[412633]: libinput error: event8  - PIXA3854:00 093A:0274 Touchpad: client bug: event processing lagging behind by 13ms, your system is too slow
Sep 21 23:19:27 gnome-shell[412633]: libinput error: event8  - PIXA3854:00 093A:0274 Touchpad: client bug: event processing lagging behind by 12ms, your system is too slow
Sep 21 23:20:07 gnome-shell[412633]: libinput error: event8  - PIXA3854:00 093A:0274 Touchpad: client bug: event processing lagging behind by 11ms, your system is too slow
Sep 21 23:20:07 gnome-shell[412633]: libinput error: event8  - PIXA3854:00 093A:0274 Touchpad: WARNING: log rate limit exceeded (5 msgs per 60min). Discarding future messages.
Sep 21 23:21:01 gnome-shell[412633]: libinput error: client bug: timer event8 gestures: scheduled expiry is in the past (-16ms), your system is too slow

Trying to quickly scroll up and down leads to lots of these kinds of messages and terrible scrolling performance. After a restart, scrolling is fine, and no messages.

I can’t quite tell if it’s actually a touchpad issue or if the machine actually is slow (not running at a high frequency after a wake?) and the touchpad stuff is just a symptom. And I don’t know what the “trigger” is, beyond noticing that it doesn’t happen until several days into running. That other inputs appear in the logs occasionally makes me think it might not really be the touchpad at fault, and it’s just that the touchpad fires off lots of events that I see it so prominently.

When I once had the system monitor up when this was happening, rapidly swiping up and down on the touchpad would easily peg the CPUs to 100%. (Again, after a reboot this doesn’t happen.) I didn’t think to look again when this happened more recently (just now), nor at the current frequency. I’ll try to remember to look at that stuff next time this happens.

Is this or something like it familiar to anyone else at all?

2 Likes

I don’t think so: it’s not a “the touchpad doesn’t work” kind of problem which most of those seem to be.

I think if nobody else has seen this happening I’ll just have to try to grab more information the next time it happens.

A possible clue, though it’s a little different…

Just now I was using the machine, everything fine, and plugged in an 8bitdo gamepad in “firmware update” mode into a USB-A port. The machine shut itself off seconds later. Nothing seems to have made it to the system logs about this.

I’ve unplugged the device and booted the machine again now and it’s running like a dog. Under essentially no load the CPU graph is all over the place:

Also at this time there’s some interesting /proc/cpuinfo results (through running grep -E 'processor|MHz' /proc/cpuinfo). Sometimes it’s like this:

processor	: 0
cpu MHz		: 199.999
processor	: 1
cpu MHz		: 200.001
processor	: 2
cpu MHz		: 200.000
processor	: 3
cpu MHz		: 199.999
processor	: 4
cpu MHz		: 200.002
processor	: 5
cpu MHz		: 200.002
processor	: 6
cpu MHz		: 200.000
processor	: 7
cpu MHz		: 199.999

though more commonly a couple cores are at 2.4Ghz:

processor	: 0
cpu MHz		: 2400.000
processor	: 1
cpu MHz		: 2400.000
processor	: 2
cpu MHz		: 199.999
processor	: 3
cpu MHz		: 200.012
processor	: 4
cpu MHz		: 200.000
processor	: 5
cpu MHz		: 200.005
processor	: 6
cpu MHz		: 200.009
processor	: 7
cpu MHz		: 2400.000

Pretty sure it’s not thermal throttling going on:

# sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +43.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +43.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +39.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +40.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +42.0°C  (high = +100.0°C, crit = +100.0°C)

BAT1-acpi-0
Adapter: ACPI interface
in0:          17.07 V  
curr1:       546.00 mA 

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +39.0°C  

nvme-pci-0100
Adapter: PCI adapter
Composite:    +44.9°C  (low  =  -0.1°C, high = +82.8°C)
                       (crit = +83.8°C)
Sensor 1:     +37.9°C  (low  = -273.1°C, high = +65261.8°C)
Sensor 2:     +39.9°C  (low  = -273.1°C, high = +65261.8°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +43.8°C  (crit = +210.0°C)

At some point I’ll restart the thing again and hope to restore full speed but I wanted to report while the problem was happening also.

I also just noticed, the power adapter, which was plugged into the top-left expansion card before and after the shutdown, doesn’t work now. The USB-A I plugged into that seemed to precipitate the problem is in the bottom-left. I pretty much always have used that same port.

The charger works if plugged into the top-right or bottom-right card instead. I just now as writing am trying out unplugging the top-left card and top-right to swap them. Still doesn’t work in the top-left port, whichever card is there.

I’m thinking this is maybe the “EM shielding” issue described in another thread?

Just a further update, on the same boot, the problem has just mysteriously worked itself out: the charger now works when plugged into any card, including in the previously-problematic top-left port. And the CPU frequencies appear normal as well.

So the problem was only ever affecting the left side, but it’s also intermittent somehow.

There’s definitely an uptime component to this as well which I think I’ve narrowed down to something like a gnome-shell memory leak (though I’m now on 21.10).

The situation where touchpad gestures start to cause significant lag seems to correlate with gnome-shell using gigabytes of RAM on its own. When things have been running for many days and gnome-shell’s memory usage is high, simply having the System Monitor open and “scrubbing” up and down on the touchpad will easily peg a core and cause substantial lag. Logging out and logging back in to the gnome session resolves the issue, and gestures/scrolling then seem to again have essentially zero performance impact.

Looking around at reports of gnome-shell memory leaks, they usually point the finger at extensions, but the only ones I’m using are Ubuntu’s “dock” and AppIndicator ones. I’m trying things out without the dock to see if that makes any difference.

@John_Flatness I just got mine this morning. Also running Ubuntu 21.10. Touchpad right click & scroll stopped after sleep via closing the laptop lid. Returned to normal after a reboot.

1 Like

I had some weird touchpad behavior after laptop would wake up from sleep. I saw somewhere a recommendation to go into BIOS and disable PS/2 mouse emulation (something like that). It did work for me. I am running Linux Mint 20.2 with 5.13.0-22-generic kernel

1 Like

Yeah there’s a few different touchpad-related things, I think.

I haven’t had sleep/wake problems really and haven’t touched the PS/2 Emulation setting in the BIOS. But I have it left on the default of s2idle sleep which maybe makes a difference there.

The problems I was talking about specifically here were, I think, associated with gnome-shell having a big memory leak: gnome-shell would be using 1-1.5 GB by itself which really affected performance quite badly, most noticeably with gestures. I removed some extra Ubuntu-packaged shell extensions, which seems to have slowed but not stopped the leak. Alongside that I have the mention early on here of the well-known CPU frequency problems which… I want to say was probably just an independent problem happening at the same time, though maybe at times both things were happening at the same time for extra awful performance.

There’s also some seemingly mechanical issues with the physical click of the touchpad, which I think I also have going on a little: clicks are a little wonky from time to time.

I have this same problem. Touchpad movement lags consistently, but there’s no problem at all when I use a USB mouse. Ubuntu 21.10 for me.

Edit: I tried disabling PS/2 emulation and updated BIOS from 3.02 → 3.07, it’s still happening.

1 Like

Same for me. Pop os 21.10
After hours of uptime Touchpad movements become very slow and laggy

It happenstance after 10+ hours of uptime. Will measure if today
But the bug happance for me first time 1-2 weeks ago.

Also got lagging touchpad recently. Been using my 11 gen batch 5 laptop for more than a year, never experienced something like that… until recently.

Kubuntu 22.04.1 LTS