Bug 217828

Summary: 26a125f550a3bf ("wifi: rtw88: correct PS calculation for SUPPORTS_DYNAMIC_PS", 2023-05-27) increases CPU usage usage for irq
Product: Drivers Reporter: Brett Hassall (brett.hassall)
Component: network-wirelessAssignee: drivers_network-wireless (drivers_network-wireless)
Status: NEW ---    
Severity: normal CC: bagasdotme, marco.rodolfi
Priority: P3    
Hardware: Intel   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:
Attachments: Patch containing 3 Ubuntu VMD commits to achieve package C8

Description Brett Hassall 2023-08-26 23:51:32 UTC
This commit improves power saving - it enables the kernel to achieve package C8. To achieve package C8, 3 Ubuntu VMD commits must be applied as well. The combined patch for the 3 Ubuntu VMD commits is attached (just in case). Package C8 lowers power usage on the laptop from 5.6W to 2.6W.

However, a side-effect of this commit is that CPU usage for irq/155-rtw88_pci has increased noticeably. This commit was introduced in 6.4-rc6. To confirm this commit is the cause, a branch was created from 6.4-rc5. This commit and the 3 Ubuntu VMD commits were applied. The resulting kernel was built and tested - it can achieve package C8 and exhibits the increased CPU usage on irq/155-rtw88_pci.

Booting and running top for 30 min with the system otherwise idle, gives these results for CPU on irq/155-rtw88_pci:
6.4-rc5     - 00:02.9, mostly   0% and 0.3% displayed
patched rc5 - 00:13.4, mostly 0.7% and 1.0% displayed
By comparison, an 8th Gen Dell with an Intel WIFI has CPU usage of 00:01.7 under the same conditions.

Laptop is a HP 15s-fq4011TU 11th Gen (Tiger Lake) Intel with (from lspci) Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter and Intel Corporation Volume Management Device NVMe RAID Controller.

Ubuntu bug https://bugs.launchpad.net/ubuntu/+source/linux-hwe-6.2/+bug/2025040 provides further background.

Please advise if I can assist with further testing.
Comment 1 Brett Hassall 2023-08-26 23:54:37 UTC
Created attachment 304946 [details]
Patch containing 3 Ubuntu VMD commits to achieve package C8
Comment 2 Bagas Sanjaya 2023-08-27 02:36:13 UTC
(In reply to Brett Hassall from comment #0)
> This commit improves power saving - it enables the kernel to achieve package
> C8. To achieve package C8, 3 Ubuntu VMD commits must be applied as well. The
> combined patch for the 3 Ubuntu VMD commits is attached (just in case).
> Package C8 lowers power usage on the laptop from 5.6W to 2.6W.
> 
> However, a side-effect of this commit is that CPU usage for
> irq/155-rtw88_pci has increased noticeably. This commit was introduced in
> 6.4-rc6. To confirm this commit is the cause, a branch was created from
> 6.4-rc5. This commit and the 3 Ubuntu VMD commits were applied. The
> resulting kernel was built and tested - it can achieve package C8 and
> exhibits the increased CPU usage on irq/155-rtw88_pci.
> 
> Booting and running top for 30 min with the system otherwise idle, gives
> these results for CPU on irq/155-rtw88_pci:
> 6.4-rc5     - 00:02.9, mostly   0% and 0.3% displayed
> patched rc5 - 00:13.4, mostly 0.7% and 1.0% displayed
> By comparison, an 8th Gen Dell with an Intel WIFI has CPU usage of 00:01.7
> under the same conditions.
> 
> Laptop is a HP 15s-fq4011TU 11th Gen (Tiger Lake) Intel with (from lspci)
> Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network
> Adapter and Intel Corporation Volume Management Device NVMe RAID Controller.
> 
> Ubuntu bug
> https://bugs.launchpad.net/ubuntu/+source/linux-hwe-6.2/+bug/2025040
> provides further background.
> 
> Please advise if I can assist with further testing.

On mainline, I instead got 26a125f550a3bf with the same commit title.
Can you check it?
Comment 3 Brett Hassall 2023-08-27 04:10:07 UTC
26a125f550a3bf is correct. My bad, that ID is a legacy of my build process.
Comment 4 Marco 2023-10-06 08:10:16 UTC
Oh,wow,since switching to a distro following 6.4 I experienced these huge stutters for a second after exiting sleep on a Steam Deck and I guessed   there was some interrupts issues, but yeah, this is probably the same problem I'm experiencing.
Comment 5 Brett Hassall 2023-10-18 10:36:52 UTC
Under mainline 6.5 (no other commits applied), CPU usage in 'top' is constantly 0.7%. CPU usage by irq/155/-rtw88_pci is the highest on the system.
This CPU usage occurs without the package C8 being achieved.

So, the original assumption that this was related to pkg C8 may have been only coincidence.