I installed EndeavourOS on luks encrypted BTRFS. At the beginning, everything worked well. But after couple of weeks, system started to freeze randomly. Now after booting it is constantly freezing. like it responds for couple of seconds then freezes for minutes. and the freeze is weird, if a tab is open i can interact with it but new tab, terminal shells freezes.
There are multiple BTRFS related hung task error and stack traces in dmesg like this,
[ 1598.507615] INFO: task glean.dispatche:4681 blocked for more than 122 seconds.
[ 1598.507616] Tainted: G W 6.16.4-arch1-1 #1
[ 1598.507617] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
[ 1598.507619] task:glean.dispatche state:D stack:0 pid:4681 tgid:4632 ppid:1 task_flags:0x400040 flags:0x00004002
[ 1598.507622] Call Trace:
[ 1598.507623]
[ 1598.507625] __schedule+0x409/0x1330
[ 1598.507628] ? __reserve_bytes+0x33f/0x700
[ 1598.507632] schedule+0x27/0xd0
[ 1598.507635] wait_current_trans+0x107/0x170
[ 1598.507637] ? __pfx_autoremove_wake_function+0x10/0x10
[ 1598.507641] start_transaction+0x441/0x840
[ 1598.507644] btrfs_create_common+0xaa/0x130
[ 1598.507649] path_openat+0x1024/0x12e0
[ 1598.507652] do_filp_open+0xd8/0x180
[ 1598.507656] ? alloc_fd+0x12e/0x190
[ 1598.507658] do_sys_openat2+0x88/0xe0
[ 1598.507661] ? task_tick_fair+0x5e/0x4c0
[ 1598.507666] __x64_sys_openat+0x61/0xa0
[ 1598.507670] do_syscall_64+0x81/0x970
[ 1598.507672] ? smp_call_function_single_async+0x22/0x50
[ 1598.507677] ? update_process_times+0xa4/0xd0
[ 1598.507681] ? tick_nohz_handler+0xb1/0x140
[ 1598.507686] ? timerqueue_add+0xae/0xd0
[ 1598.507691] ? __hrtimer_run_queues+0x164/0x2a0
[ 1598.507693] ? rcu_accelerate_cbs+0x27/0x90
[ 1598.507698] ? sched_clock+0x10/0x30
[ 1598.507704] ? sched_clock_cpu+0xf/0x200
[ 1598.507707] ? rcu_core+0x199/0x350
[ 1598.507710] ? flush_tlb_func+0x23f/0x2a0
[ 1598.507715] ? sched_clock+0x10/0x30
[ 1598.507719] ? sched_clock_cpu+0xf/0x200
[ 1598.507722] ? __flush_smp_call_function_queue+0xab/0x410
[ 1598.507724] ? sched_clock_cpu+0xf/0x200
[ 1598.507728] ? irqtime_account_irq+0x3c/0xc0
[ 1598.507731] ? __irq_exit_rcu+0x4c/0xf0
[ 1598.507736] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[ 1598.507738] RIP: 0033:0x7fed0589f042
[ 1598.507743] RSP: 002b:00007fecf14fdf08 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
[ 1598.507745] RAX: ffffffffffffffda RBX: 00007fed05827990 RCX: 00007fed0589f042
[ 1598.507746] RDX: 0000000000080241 RSI: 00007fecf14fdfd8 RDI: ffffffffffffff9c
[ 1598.507748] RBP: 00007fecf14fdf30 R08: 0000000000000000 R09: 0000000000000000
[ 1598.507749] R10: 00000000000001b6 R11: 0000000000000246 R12: 0000000000080241
[ 1598.507750] R13: 00007fed0590d270 R14: 00000000000001b6 R15: 00007fecf14fdfd8
EDIT [1]: attaching system info
CPU: 14-core (4-mt/10-st) Intel Core Ultra 5 125H (-MST AMCP-)
speed/min/max: 400/400/4500:3600:2500 MHz Kernel: 6.16.4-arch1-1 x86_64
Up: 43m Mem: 3.52/15.05 GiB (23.4%) Storage: 476.94 GiB (67.4% used)
Procs: 379 Shell: Sudo inxi: 3.3.39
Drives:
Local Storage: total: 476.94 GiB used: 321.62 GiB (67.4%)
ID-1: /dev/nvme0n1 vendor: SK Hynix model: HFS512GEJ4X112N
size: 476.94 GiB
EDIT [2]: added system info and btrfs logs
sysinfo: https://dpaste.com/2SNPJ3HQ9
btrfs logs: https://0x0.st/Kmgf.txt