NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.05k stars 14.09k forks source link

NetworkManager keep 100% CPU usage after upgraded to 23.11 #278005

Closed xinyifly closed 6 months ago

xinyifly commented 10 months ago

Describe the bug

After upgraded to 23.11 from 23.05, the network manager process is keeping at 100% CPU usage.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Upgrade to 23.11 from 23.05
  2. Launch top and sort by CPU usage
  3. Note that NetworkManager process CPU usage at 100%

Expected behavior

NetworkManager process should have a normal CPU usage.

Screenshots

Under 23.11

2024-01-01T12:38:57,788763724+08:00

Under 23.05

2024-01-01T12:51:03,486082950+08:00

Additional context

[nix-shell:~]$ lspci | grep -i network
3a:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)

Provide that I'm using DELL XPS 13 9360

[nix-shell:~]$ neofetch --off
xinyifly@dell
-------------
OS: NixOS 23.11.20231225.d02d818 (Tapir) x86_64
Host: Dell Inc. 0PVG6D
Kernel: 6.1.69
Uptime: 8 mins
Packages: 831 (nix-system), 1394 (nix-user), 2 (nix-default)
Shell: bash 5.2.15
Resolution: 1920x1080
WM: sway
Terminal: alacritty
CPU: Intel i5-8250U (8) @ 3.400GHz
GPU: Intel UHD Graphics 620
Memory: 3151MiB / 7683MiB

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.69, NixOS, 23.11 (Tapir), 23.11.20231225.d02d818`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - channels(xinyifly): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

bjornfor commented 10 months ago

Maybe NetworkManager got into a weird state? Can you try resetting its state (or run from a live medium)?

xinyifly commented 9 months ago

I found that NetworkManger goes up 100% CPU usage once a program using a TUN device is running. Either I started tailscaled or Clash Meta.

Another probably related information: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1756 connectivity: Make curl timeout callback non-repeating.

xinyifly commented 6 months ago

I found that this config caused the issue:

{
  networking.networkmanager.extraConfig = ''
    [connectivity]
    uri=http://g.cn/generate_204
    response=
    interval=5
  '';
}