You are not logged in.

#1 2023-12-14 13:44:25

A simple duck
Member
Registered: 2023-05-12
Posts: 18

System randomly freezes for 10-15 seconds

Hello , recently my computer started having problems
Desktop apps randomly freeze for 10-15 seconds , during which the window manager(i3wm) and cursor remain responsive. Also executing any command through the terminal takes too long(10-20 seconds).It seems that commands are cached in memory, as subsequent uses show faster response times.
Log files
dmesg - https://pastebin.com/DZ6M0USa
journalctl https://pastebin.com/zEZYT4SB

Offline

#2 2023-12-14 15:18:00

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,232

Re: System randomly freezes for 10-15 seconds

Update your system, there's a critical regression in the wifi implementation/the network stack for kernels 6.6.4 and 6.6.5 which got fixed in 6.6.6

Offline

#3 2023-12-15 03:28:04

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

Okay i have updated to 6.6.7 and switched from linux-zen to linux unfortunately the system still freezes
Notably while leaving it running overnight the home btrfs system went readonly (/ and /home are on separate discs)
https://pastebin.com/QMqg1bSM dmesg
Rebooting seemed to fix it.

https://pastebin.com/yumPtN6e smartctl -x /dev/sda

Last edited by A simple duck (2023-12-15 03:38:47)

Offline

#4 2023-12-15 08:31:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: System randomly freezes for 10-15 seconds

The dmesg excerpt describes a symptom but cannot possibly hint at the cause, please post your complete system journal for the boot, eg:

sudo journalctl -b -1 | curl -F 'file=@-' 0x0.st

for the previous ("-1") one.

smartctl looks more like bus errors, but it's not like btrfs needs HW issues to shit the bed…

Offline

#5 2023-12-15 13:25:53

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

Just in case ill post the last 3 reboots....(not too sure on which boot /home went readonly)
http://0x0.st/HYNQ.txt (journalctl -b -1)
https://0x0.st/HYNe.txt (journalctl -b -2)
https://0x0.st/HYN_.txt (journalctl -b -3)

Offline

#6 2023-12-15 15:14:23

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: System randomly freezes for 10-15 seconds

Are you combining the nvme and the ata drive in a raid?

Offline

#7 2023-12-15 15:16:48

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

No, the nvme drive stores / , the sata hdd stores /home(both btrfs)
On the hdd there are 3 subvolumes (https://pastebin.com/JgDXTAeh)
@home , @.snapshots_home(which is mounted to /home/.snapshots) and @nocow (which is mounted to /home/gaurav/Downloads)
On the ssd there are four subvolumes (https://pastebin.com/FWqktH3Y)
@log @pkg @.snapshots(mounted to /.snapshots) @

Last edited by A simple duck (2023-12-15 15:23:25)

Offline

#8 2023-12-15 15:37:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: System randomly freezes for 10-15 seconds

So at least for boot -1 we've a balance operation (on sda) crossing an S3

Dec 14 18:25:14 hp-pav kernel: ACPI: PM: Waking up from system sleep state S3
Dec 14 18:25:14 hp-pav systemd-sleep[4825]: System returned from sleep operation 'suspend'.
Dec 14 18:25:15 hp-pav systemd[1]: Stopped target Sleep.
Dec 14 18:25:15 hp-pav systemd-logind[623]: Operation 'sleep' finished.
Dec 14 18:25:15 hp-pav NetworkManager[639]: <info>  [1702558515.1520] manager: sleep: wake requested (sleeping: yes  enabled: yes)
Dec 14 19:17:54 hp-pav kernel: BTRFS info (device sda): balance: start -d -m -s
Dec 14 19:17:55 hp-pav kernel: BTRFS info (device sda): balance: canceled
Dec 14 19:54:24 hp-pav kernel: BTRFS info (device nvme0n1p2): balance: start -d -m -s
Dec 14 19:54:28 hp-pav kernel: BTRFS info (device sda): balance: start -d -m -s
Dec 14 20:01:02 hp-pav kernel: BTRFS info (device nvme0n1p2): balance: ended with status: 0
Dec 14 20:30:49 hp-pav systemd[1]: Reached target Sleep.
Dec 14 20:30:49 hp-pav systemd-sleep[1364615]: Performing sleep operation 'suspend'...
Dec 14 20:31:39 hp-pav kernel:  btrfs_balance+0xe1f/0x1830 [btrfs 09f28f9862d15aab868fd6a576289d8bb5d241dd]
Dec 14 20:32:10 hp-pav kernel:  btrfs_balance+0xe1f/0x1830 [btrfs 09f28f9862d15aab868fd6a576289d8bb5d241dd]
Dec 14 20:32:10 hp-pav systemd-sleep[1364615]: Failed to put system to sleep. System resumed again: Device or resource busy
Dec 14 20:32:11 hp-pav systemd[1]: Stopped target Sleep.
Dec 14 20:32:11 hp-pav systemd-logind[623]: Operation 'sleep' finished.
Dec 14 20:32:11 hp-pav NetworkManager[639]: <info>  [1702566131.1420] manager: sleep: wake requested (sleeping: yes  enabled: yes)
Dec 15 01:00:03 hp-pav kernel:  btrfs_balance+0xe1f/0x1830 [btrfs 09f28f9862d15aab868fd6a576289d8bb5d241dd]
Dec 15 01:00:03 hp-pav kernel: BTRFS info (device sda: state EA): balance: ended with status: -5

You could use a system sleep hook to sigstop/sigcont balance processes if this is a constant pattern.
https://wiki.archlinux.org/title/Power_ … leep_hooks

Boot -2 "only" has

Dec 14 18:01:46 hp-pav kernel: BTRFS info (device sda): start tree-log replay
Dec 14 18:01:48 hp-pav systemd[1]: systemd-rfkill.service: Deactivated successfully.
Dec 14 18:03:13 hp-pav systemd[1]: home.mount: Mounting timed out. Terminating.
Dec 14 18:03:36 hp-pav kernel: BTRFS info (device sda): checking UUID tree
Dec 14 18:04:07 hp-pav kernel: BTRFS warning (device sda): failed to start uuid_rescan task
Dec 14 18:04:07 hp-pav kernel: BTRFS warning (device sda): failed to check the UUID tree: -4
Dec 14 18:04:07 hp-pav kernel: BTRFS error (device sda): open_ctree failed

(avoid rebooting w/ the power button at all costs)
=> https://wiki.archlinux.org/title/Btrfs# … ree_failed

Boot -3 likewise ends abruptly

Dec 14 18:01:04 hp-pav /usr/lib/gdm-x-session[1723]: polybar|notice:  Received signal(15): Terminated
Dec 14 18:01:04 hp-pav /usr/lib/gdm-x-session[1723]: polybar|notice:  Termination signal received, shutting down...
Dec 14 18:01:04 hp-pav at-spi2-registryd[1703]: X connection to :0 broken (explicit kill or server shutdown).

but no signs of sda or btrfs issues.

There's no indication for bus/device IO errors, so this is likely a btrfs-problem.

Offline

#9 2023-12-15 16:13:01

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

Thank you for your detailed response
So would the sleep hook look something like this....
(suspend@.service)

ExecStart=/usr/bin/pkill -SIGSTOP btrfs

(resume@.service)

ExecStart=/usr/bin/pkill -SIGCONT btrfs

As a potential solution to address Btrfs issues, would it be wise to run btrfs-check with the home unmounted?(from a boot-able usb)

Last edited by A simple duck (2023-12-15 16:16:34)

Offline

#10 2023-12-15 20:20:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: System randomly freezes for 10-15 seconds

Proably rather killall and those are not correctly syntaxed (complete) service files, you can also use the script hooks if you prefer.
But that's the principal idea, yes. Did you check whether this (S3 crossing a balance  or scrub) is a constant pattern of the issue?

Offline

#11 2023-12-16 04:21:13

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

No , it does not seem to be a common pattern....

Offline

#12 2023-12-16 08:15:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: System randomly freezes for 10-15 seconds

Do you have other logs illustrating the stalls/red-only remounts then?

Offline

#13 2023-12-16 16:24:13

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

That was the first time the system went read only, so no other logs... and when the system freezes journalctl does not show anything unusual (it complains about "Xlib: ignoring invalid extension event 161"  but i think thats normal)

Offline

#14 2023-12-16 18:13:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: System randomly freezes for 10-15 seconds

So the btrfs condition is probably a red herring - do you have a system journal and xorg log covering such freeze (and ideally a round-a-bout timestamp where the freeze happened)?

ignoring invalid extension event 161

That's gonna be some compositor

loginctl session-status

Offline

#15 2023-12-19 10:56:21

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

https://0x0.st/Hg-V.txt (output for logcinctl)

Offline

#16 2023-12-19 13:39:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: System randomly freezes for 10-15 seconds

seth wrote:

That's gonna be some compositor

         ├─ 3790 picom

Do you get the freezes if you kill picom?

├─ 3643 "gdm-session-worker [pam/gdm-password]"

Does GDM run on X11 or wayland?
What if you disable GDM and just start the session w/ startx?

Offline

#17 2023-12-19 14:20:28

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

OK ill try your suggestions and see if the lag goes away, i think gdm runs on wayland as i have wayland enabled(trying out sway)

Offline

#18 2023-12-19 15:48:07

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

So far the system has not frozen.... Although unsure if it was picom or GDM , ill try enabling and disabling each one to check who was causing the stutters
Ideally i would not want to disable picom so is there any option i can change in my config file?
https://0x0.st/HgHM.txt(picom config)

Last edited by A simple duck (2023-12-19 15:50:37)

Offline

#19 2023-12-19 16:50:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: System randomly freezes for 10-15 seconds

backend = "glx";
blur-kern = "3x3box";
blur-method = "dual_kawase"
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
vsync = true;

Try the randr backend, if that helps whether it's vsync or blurring and I'm not sure why you'd disable stencil buffers.
One thing to notice is that you're running the server on the nvidia chip but the eDP is attached to the intel chip.
Any reason why this isn't a regular prime setup (server runs on intel, you prime-run games when you want to)?
If you're permanently use the external HP monitor and would prefer to run the system on the nvidia chip (because of this and in general etc et pp), you're probably better off disablign the intel IGP in the UEFI and use the dGPU exclusively.

Offline

#20 2023-12-20 06:39:55

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

OK i will try those options.
Unfortunately my bios does not have any option to disable the iGPU.
I am using envycontrol to run all monitors through the dGPU. Using nvidia-prime causes the external monitor to have very bad performance and a lot of screen tearing.(the HDMI port on my laptop is directly connected to the nvidia gpu)

Last edited by A simple duck (2023-12-20 06:42:28)

Offline

#21 2023-12-24 15:06:53

A simple duck
Member
Registered: 2023-05-12
Posts: 18

Re: System randomly freezes for 10-15 seconds

Issue has beem solved by using compfy as a compositor and startx

Offline

Board footer

Powered by FluxBB