Currently I’ve had occasional race conditions with btrfs on my system. This seems related to many subvolumes. The relevant log entries are below.
Sep 22 09:07:26 rocky.gamull.com kernel: Workqueue: btrfs-delayed-meta btrfs_delayed_meta_helper [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: Call Trace:
Sep 22 09:07:26 rocky.gamull.com kernel: __schedule+0x28a/0x880
Sep 22 09:07:26 rocky.gamull.com kernel: schedule+0x36/0x80
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_tree_lock+0xad/0x210 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: ? remove_wait_queue+0x60/0x60
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_search_slot+0x714/0x9b0 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: ? __enqueue_entity+0x6c/0x70
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_lookup_inode+0x3e/0xc0 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: ? btrfs_insert_delayed_items+0xc0/0x480 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: __btrfs_update_delayed_inode+0x74/0x220 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_async_run_delayed_root+0x1e1/0x200 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: normal_work_helper+0x136/0x2f0 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_delayed_meta_helper+0x12/0x20 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: process_one_work+0x149/0x360
Sep 22 09:07:26 rocky.gamull.com kernel: worker_thread+0x4d/0x3c0
Sep 22 09:07:26 rocky.gamull.com kernel: kthread+0x109/0x140
Sep 22 09:07:26 rocky.gamull.com kernel: ? rescuer_thread+0x380/0x380
Sep 22 09:07:26 rocky.gamull.com kernel: ? kthread_park+0x60/0x60
Sep 22 09:07:26 rocky.gamull.com kernel: ? do_syscall_64+0x67/0x150
Sep 22 09:07:26 rocky.gamull.com kernel: ret_from_fork+0x25/0x30
Sep 22 09:07:26 rocky.gamull.com kernel: INFO: task kworker/u50:4:9322 blocked for more than 120 seconds.
Sep 22 09:07:26 rocky.gamull.com kernel: Tainted: G I 4.12.4-1.el7.elrepo.x86_64 #1
Sep 22 09:07:26 rocky.gamull.com kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Sep 22 09:07:26 rocky.gamull.com kernel: kworker/u50:4 D 0 9322 2 0x00000080
Sep 22 09:07:26 rocky.gamull.com kernel: Workqueue: btrfs-delayed-meta btrfs_delayed_meta_helper [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: Call Trace:
Sep 22 09:07:26 rocky.gamull.com kernel: __schedule+0x28a/0x880
Sep 22 09:07:26 rocky.gamull.com kernel: schedule+0x36/0x80
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_tree_lock+0xad/0x210 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: ? remove_wait_queue+0x60/0x60
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_search_slot+0x714/0x9b0 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: ? start_transaction+0x120/0x440 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_lookup_inode+0x3e/0xc0 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: ? btrfs_insert_delayed_items+0xc0/0x480 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: __btrfs_update_delayed_inode+0x74/0x220 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_async_run_delayed_root+0x1e1/0x200 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: normal_work_helper+0x136/0x2f0 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: btrfs_delayed_meta_helper+0x12/0x20 [btrfs]
Sep 22 09:07:26 rocky.gamull.com kernel: process_one_work+0x149/0x360
Sep 22 09:07:26 rocky.gamull.com kernel: worker_thread+0x4d/0x3c0
Sep 22 09:07:26 rocky.gamull.com kernel: kthread+0x109/0x140
Sep 22 09:07:26 rocky.gamull.com kernel: ? rescuer_thread+0x380/0x380
Sep 22 09:07:26 rocky.gamull.com kernel: ? kthread_park+0x60/0x60
Sep 22 09:07:26 rocky.gamull.com kernel: ? do_syscall_64+0x67/0x150
Sep 22 09:07:26 rocky.gamull.com kernel: ret_from_fork+0x25/0x30
I’ve heard adding serialization may help with this, it seems to be related to having many subvolumes