High cpu usage and laggy PC after update

After updating the pc with recent update everything is super slow and pc is lagging alot and seeing high CPU spikes

Logs

  Kernel: 6.9.12-200.fc40.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.41-37.fc40
  Desktop: GNOME v: 46.3.1 tk: GTK v: 3.24.43 wm: gnome-shell dm: GDM
    Distro: Fedora Linux 40 (Workstation Edition)
Machine:
  Type: Laptop System: HP product: HP Pavilion Gaming Laptop 15-ec1xxx v: N/A
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: HP model: 87B1 v: 31.23 serial: <superuser required>
    part-nu: 183L9PA#ACJ UEFI: AMI v: F.25 date: 08/18/2021
Battery:
  ID-1: BAT0 charge: 42.5 Wh (100.0%) condition: 42.5/42.5 Wh (100.0%)
    volts: 12.7 min: 11.6 model: Hewlett-Packard Primary serial: N/A
    status: full
CPU:
  Info: 6-core model: AMD Ryzen 5 4600H with Radeon Graphics bits: 64
    type: MT MCP arch: Zen 2 rev: 1 cache: L1: 384 KiB L2: 3 MiB L3: 8 MiB
  Speed (MHz): avg: 899 high: 1400 min/max: 1400/3000 boost: enabled cores:
    1: 399 2: 1400 3: 1400 4: 399 5: 399 6: 399 7: 1400 8: 399 9: 399 10: 1400
    11: 1400 12: 1400 bogomips: 71868
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q]
    vendor: Hewlett-Packard driver: nvidia v: 555.58.02 arch: Turing pcie:
    speed: 8 GT/s lanes: 8 ports: active: none off: HDMI-A-1 empty: none
    bus-ID: 01:00.0 chip-ID: 10de:1f99
  Device-2: AMD Renoir [Radeon Vega Series / Radeon Mobile Series]
    vendor: Hewlett-Packard driver: amdgpu v: kernel arch: GCN-5 pcie:
    speed: 8 GT/s lanes: 16 ports: active: none off: eDP-1 empty: none
    bus-ID: 05:00.0 chip-ID: 1002:1636 temp: 44.0 C
  Device-3: Quanta HP TrueVision HD Camera driver: uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 bus-ID: 3-3:2 chip-ID: 0408:5365
  Display: x11 server: X.Org v: 1.20.14 with: Xwayland v: 24.1.1
    compositor: gnome-shell driver: X: loaded: amdgpu,nvidia
    unloaded: fbdev,modesetting,nouveau,vesa alternate: nv dri: radeonsi
    gpu: amdgpu,nvidia,nvidia-nvswitch display-ID: :0 screens: 1
  Screen-1: 0 s-res: 2560x1080 s-dpi: 96
  Monitor-1: HDMI-A-1 mapped: HDMI-0 note: disabled pos: primary
    model: LG (GoldStar) HDR WFHD res: 2560x1080 dpi: 81 diag: 869mm (34.2")
  Monitor-2: eDP-1 mapped: eDP-1-0 note: disabled
    model: ChiMei InnoLux 0x150d res: 2560x1080 dpi: 142 diag: 394mm (15.5")
  API: OpenGL v: 4.6.0 vendor: nvidia v: 555.58.02 glx-v: 1.4
    direct-render: yes renderer: NVIDIA GeForce GTX 1650/PCIe/SSE2
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
Audio:
  Device-1: NVIDIA vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    pcie: speed: 2.5 GT/s lanes: 8 bus-ID: 01:00.1 chip-ID: 10de:10fa
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Hewlett-Packard
    driver: N/A pcie: speed: 8 GT/s lanes: 16 bus-ID: 05:00.5 chip-ID: 1022:15e2
  Device-3: AMD Family 17h/19h HD Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: speed: 8 GT/s lanes: 16
    bus-ID: 05:00.6 chip-ID: 1022:15e3
  API: ALSA v: k6.9.12-200.fc40.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.0.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel pcie: speed: 2.5 GT/s
    lanes: 1 port: e000 bus-ID: 02:00.0 chip-ID: 10ec:8168
  IF: eno1 state: down mac: <filter>
  Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel pcie:
    speed: 5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:2723
  IF: wlo1 state: up mac: <filter>
  IF-ID-1: docker0 state: down mac: <filter>
Bluetooth:
  Device-1: Intel AX200 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 bus-ID: 1-4:3 chip-ID: 8087:0029
  Report: btmgmt ID: hci0 rfk-id: 3 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: <filter> bt-v: 5.2 lmp-v: 11
Drives:
  Local Storage: total: 1.36 TiB used: 1.09 TiB (79.9%)
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WDS500G2B0C-00PXH0
    size: 465.76 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> temp: 41.9 C
  ID-2: /dev/sda vendor: Toshiba model: MQ04ABF100 size: 931.51 GiB
    speed: 6.0 Gb/s serial: <filter> temp: 35 C
Partition:
  ID-1: / size: 97.66 GiB used: 55.84 GiB (57.2%) fs: btrfs
    dev: /dev/nvme0n1p1
  ID-2: /boot/efi size: 517 MiB used: 19 MiB (3.7%) fs: vfat dev: /dev/sda3
  ID-3: /home size: 301.76 GiB used: 248.01 GiB (82.2%) fs: btrfs
    dev: /dev/sda2
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 45.0 C mobo: N/A
  Fan Speeds (rpm): fan-1: 0 fan-2: 0
  GPU: device: nvidia screen: :0.0 temp: 43 C device: amdgpu temp: 44.0 C
Info:
  Memory: total: 24 GiB note: est. available: 22.83 GiB used: 5.87 GiB (25.7%)
  Processes: 461 Power: uptime: 5h 28m wakeups: 2 Init: systemd v: 255
    target: graphical (5) default: graphical
  Packages: Compilers: gcc: 14.1.1 Shell: fish v: 3.7.0
    running-in: gnome-terminal inxi: 3.3.34

Does top gives you any hint?

No, it sudden spikes eg Firefox start utilizing 100% CPU for 10 - 12 min for no reason and it happens more if i put my pc to sleep.

it could be because of fragmented HDD but dont know any utility to check for frag levels in btrfs and built it utility take way too much time

ran a complete defrag on whole HDD took alot of time but things are looking much snapier…

Constant load on CPU, i use to run way more things before and never seen this type of load

@alciregi Hey found the bug, on power the laptop spike CPU to 100% and very bad experience but when on battery its completely fine

Same amount of process but no load on CPU

Two additional things you can look into:

  • If you look in the I/O tab of htop rather than the CPU tab, does that give any additional information?

  • Your laptop should support USB-C charging, does anything change if you use a USB charger for power instead of the standard charger?

As soon as I turn on the power cpu start going up to 100% and on battery everything come back to normal. IO remain the same in both power and battery nothing abnormal going on there.

Battery:

On Power:

it has USB C but does not support charging, i use traditional pin based charger.

I have 125W USB C charger, giving it a shot

Nope does not work

1 Like

@litemotiv So one more thing is that when on power it throttle the CPU to its minimum frequency 0.40 Ghz and that is the issue on batter its on 1.49Ghz

analyzing CPU 3:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 3
  CPUs which need to have their frequency coordinated by software: 3
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 1.40 GHz - 3.00 GHz
  available frequency steps:  3.00 GHz, 1.70 GHz, 1.40 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.40 GHz and 3.00 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 399 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: no

On Battery

analyzing CPU 4:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 4
  CPUs which need to have their frequency coordinated by software: 4
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 1.40 GHz - 3.00 GHz
  available frequency steps:  3.00 GHz, 1.70 GHz, 1.40 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.40 GHz and 3.00 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 2.42 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: no

That could explain the high load yes. What you could try is to install the package kernel-tools:

$ dnf install kernel-tools

It has a utility named cpupower that you can use to interactively set the cpu governer:

$ cpupower frequency-set -g [governor]

A few of the governors are for example:

performance: Max cpu frequency
powersave: Min cpu frequency
userspace: User set frequency
ondemand: Automatic up/down scheduling

So you can test a bit with that if that changes anything.

I used it but its not having any effect on the CPU freq. it stays at 400Mhz

Are all the cores running at 400Mhz?

This is the output from my AMD laptop:

$ sudo cpupower monitor

    | Mperf              || RAPL        || Idle_Stats                
 CPU| C0   | Cx   | Freq  || pack | core  || POLL | C1   | C2   | C3    
   0|  2.25| 97.75|  1354||3018490| 60879||  0.00|  0.00|  4.21| 93.93
   1|  0.15| 99.85|  1357||3018490| 60879||  0.00|  0.00|  0.00| 99.75
   2|  5.68| 94.32|  1727||3018490| 60879||  0.00|  0.12|  9.71| 84.89
   3|  2.10| 97.90|  1397||3018490| 60879||  0.00|  0.00|  0.00| 97.99
   4|  5.20| 94.80|  2114||3018490| 60879||  0.00|  0.22| 19.98| 75.00
   5|  7.04| 92.96|  1825||3018490| 60879||  0.00|  0.01|  0.08| 93.09
   6|  3.15| 96.85|  1453||3018490| 60879||  0.00|  0.01|  8.90| 88.28
   7|  0.31| 99.69|  1393||3018490| 60879||  0.00|  0.00|  1.18| 98.52
   8|  4.47| 95.53|  1519||3018490| 60879||  0.00|  0.01| 11.59| 84.34
   9|  0.10| 99.90|  1641||3018490| 60879||  0.00|  0.00|  0.49| 99.34
  10|  2.92| 97.08|  1375||3018490| 60879||  0.00|  0.01|  4.80| 92.48
  11|  0.19| 99.81|  2140||3018490| 60879||  0.00|  0.00|  0.00| 99.81

(you will need to run as sudo/root)

Yes sal

Seems like you found the issue Knight Crusty, that’s really interesting. This seems like a proper bug, i’m not sure what you could otherwise do to work around this…

Dont know but somehow the freq is set to 1.40Ghz so its much better atleast usable when plugged in. someone reported similar issue with kernel here

The second item after firefox is 72% in /usr/share/code/code, which is Visual Studio Code.
Do you have something running in it?
Is it fighting with firefox, for example, both trying to update windows that overlap?
Applications can tell whether the laptop is on adapter or on battery, depending on the laptop model and version of Linux, “cat /sys/class/power_supply/AC/online”, “cat /proc/acpi/ac_adapter/AC/state”, “upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep state”, for example.
Maybe firefox or VS Code has some cleanup to do or some updates to apply that wait until the laptop is on AC power.

Nope, no updates going on, the only problem is when on AC power, laptop CPU throttle to 400MHz all cores and that is why you are seeing 100% utilization

Same issue here with a desktop running Fedora 40. Just updated Fedora and on reboot everything runs fine for a few minutes and then it just slows down to a crawl. There is a bug somewhere in the latest updates. I will be using Timeshift to revert back to before the updates until the developers get their act together.

Switching to LTS kernel could fix it…