Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* qgroup rescan worker makes suspend fail
@ 2026-09-19 13:40 Richard Weinberger
  2026-09-19 17:34 ` Johannes Thumshirn
  2026-09-19 23:38 ` Qu Wenruo
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Weinberger @ 2026-09-19 13:40 UTC (permalink / raw)
  To: linux-btrfs; +Cc: johannes.thumshirn

Once in a while, suspending my laptop just causes the screen to freeze.
Initially, I thought Linux had crashed, but it usually recovers after 2 minutes,
though the suspend doesn't actually happen. You can imagine this can be very
unfortunate when you just close the laptop lid and pack the laptop into your
bag...

After the problem started occurring more frequently, I investigated and found
that the qgroup rescan worker is the problem. In dmesg, logs like these can
usually be found:

[246013.777637] [ T278489] Freezing remaining freezable tasks
[246033.780538] [ T278489] Freezing remaining freezable tasks failed after 20.003 seconds (0 tasks refusing to freeze, wq_busy=1):
[246033.780576] [ T278489] Showing freezable workqueues that are still busy:
[246033.780582] [ T278489] workqueue events_freezable: flags=0x104
[246033.780590] [ T278489]   pwq 10: cpus=2 node=0 flags=0x0 nice=0 active=0 refcnt=2
[246033.780609] [ T278489]     inactive: pci_pme_list_scan
[246033.780642] [ T278489] workqueue btrfs-endio-meta: flags=0xe
[246033.780649] [ T278489]   pwq 57: cpus=0-13 node=0 flags=0x4 nice=0 active=0 refcnt=2
[246033.780660] [ T278489]     inactive: simple_end_io_work [btrfs]
[246033.781183] [ T278489] workqueue btrfs-qgroup-rescan: flags=0x2000e
[246033.781189] [ T278489]   pwq 56: cpus=0-13 flags=0x4 nice=0 active=1 refcnt=16
[246033.781199] [ T278489]     in-flight: 205929:btrfs_work_helper [btrfs] for 111s
[246033.781721] [ T278489] workqueue wg-kex-wginterproc: flags=0x6
[246033.781726] [ T278489]   pwq 57: cpus=0-13 node=0 flags=0x4 nice=0 active=0 refcnt=2
[246033.781736] [ T278489]     inactive: wg_packet_handshake_send_worker [wireguard]

My first thought was that the worker is likely not freezable, but it is.
The problem is that the whole qgroup rescan is a single work item.
In my case, such a scan can take up to 10 minutes, even though I have a
fast NVMe SSD installed...

Wouldn't it make sense to have rescan_should_stop() return true when
suspend starts? I think using a pm notifier could help here.
What do you think?

Thanks,
//richard

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-20 13:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-19 13:40 qgroup rescan worker makes suspend fail Richard Weinberger
2026-09-19 17:34 ` Johannes Thumshirn
2026-09-19 18:33   ` AW: " Richard Weinberger
2026-09-19 22:39   ` Qu Wenruo
2026-09-19 22:48     ` Qu Wenruo
2026-09-20  4:56     ` Andrei Borzenkov
2026-09-20  5:28       ` Qu Wenruo
2026-09-19 23:38 ` Qu Wenruo
2026-09-20 13:04   ` AW: " Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox