High CPU usage (kernel threads) in idle F31 / Poor UX responsiveness

I was able to fix the issue adding the following kernel args:
initcall_blacklist=dw_i2c_init_driver module_blacklist=idma64

(touchpad and everything seems to work. Not sure if there is any other side effect or performance degradation. Maybe battery life? idma64: Enable DMA support for Intel Low Power Subsystem such as found on Intel Skylake PCH. ).

I’m experiencing a much better system response (regular processing; mouse/keyboard IO, etc). CPU usage is regular (<2% in all cores when idle). Before it was ~90% in one core all of the time. Since it’s kernel threads/time it does not appear by default in some resource monitors.

The issue was introduced somewhere after kernel 4.1.x. I tested with Fedora 22 (kernel 4.0.4) and it works just fine. Other distros like ubuntu (even with recent kernels 5.x+) does not present the issue.

Although it seems a specific edge case and hardware issue unrelated with Fedora, I still consider it to be something pending fix in the Fedora distro, because:

  • Other distros using the same kernel don’t have this issue. ie. Ubuntu.
  • It used to work in earlier Fedora (ie. F22) and was introduced somewhere between F22-F31.
  • The ‘i2c/irq/touchpad’ issue may be present in a large number of devices (many other elan/synaptics)
  • It’s not catastrophic in a sense that every user observes it: many users may be suffering performance degradation and just considering it to be the regular Fedora performance (unless you specifically search for kernel threads time – by default it does not appear in the regular system-monitor CPU usage).

Further debug info. Since it works fine in F22, I found some divergent details that may indicate the root cause:

Updated issue overview: some i2c hardware driver (usually touchpad related) seems to conflict with other devices and constantly generate a high amount of interrupts, causing system performance and responsiveness degradation. Performance is impacted, but hardware components do work (ie. touchpad works fine). The high CPU usage is kernel threads and not observed by default in all monitors (ie. red bar in htop or hi section of top).

Fedora 22 kernel 4.0.4 (works):

00:1f.4 SMBus: Intel Corporation Device 9d23 (rev 21)
	Interrupt: pin A routed to IRQ 16
	Kernel modules: i2c_i801

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
	Interrupt: pin A routed to IRQ 126	
	Kernel driver in use: r8169

Fedora 31 kernel 5.5.7:

00:15.0 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO I2C Controller #0 (rev 21)
	Interrupt: pin A routed to IRQ 16
	Kernel driver in use: intel-lpss

00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
	Interrupt: pin A routed to IRQ 16
	Kernel driver in use: i801_smbus
	Kernel modules: i2c_i801

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
	Interrupt: pin A routed to IRQ 16
	Kernel driver in use: r8169
	Kernel modules: r8169	

Interrupt 16 is not present in F22. In F31:

cat /proc/interrupts:
  16:          0    2833163          0          0  IR-IO-APIC   16-fasteoi   i2c_designware.0, idma64.0, i801_smbus

tree:
/proc/irq/16
├── affinity_hint
├── effective_affinity
├── effective_affinity_list
├── i2c_designware.0
├── i801_smbus
├── idma64.0
├── node
├── smp_affinity
├── smp_affinity_list
└── spurious

The presence of multiple modules/devices routed to IRQ 16 could be the issue?

tree /proc/irq/16 5.5.7-200.fc31.x86_64

/proc/irq/16
├── affinity_hint
├── effective_affinity
├── effective_affinity_list
├── i2c_designware.0
├── i801_smbus
├── idma64.0
├── node
├── smp_affinity
├── smp_affinity_list
└── spurious

/proc/irq/16 not present in F22 (works ok).

Full logs:
dmesg_4.0.4-301.fc22.x86_64_loglevel-max.txt - Ubuntu Pastebin
dmesg_5.5.7-200.fc31.x86_64_loglevel-max.txt - Ubuntu Pastebin
lscpi-vvv_4.0.4-301.fc22.x86_64.txt - Ubuntu Pastebin
lspci-vvv_5.5.7-200.fc31.x86_64.txt - Ubuntu Pastebin

PS: is there a more appropriate way of attaching logs here in Ask Fedora?

Ref: linux - How do I disable I2C Designware support when it's not built as a module? - Unix & Linux Stack Exchange

1 Like