http://bugzilla.opensuse.org/show_bug.cgi?id=1165434 Bug ID: 1165434 Summary: btrfs balance stuck in endless loop causing high I/O but never finishes on 4.12.14-lp151.28.36-default as well as 5.5.6-4.geca1eba-vanilla Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.1 Hardware: Other OS: Other Status: NEW Severity: Major Priority: P5 - None Component: Kernel Assignee: kernel-maintainers@forge.provo.novell.com Reporter: okurz@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- ## Observation btrfs balance seems to be stuck in a loop in the background causing high I/O. Messages like the following: ``` Mar 02 13:05:00 linux-28d6.suse kernel: BTRFS info (device dm-1): found 35 extents Mar 02 13:05:00 linux-28d6.suse kernel: BTRFS info (device dm-1): found 35 extents Mar 02 13:05:01 linux-28d6.suse kernel: BTRFS info (device dm-1): found 35 extents … ``` repeated endlessly on 4.12.14-lp151.28.36-default. `btrfs balance status /` seems to be stuck at "100% left". On 5.5.6-4.geca1eba-vanilla I was either a bit lucky and it continued further or it seems to be different behaviour on the newer version. `btrfs balance status /` reports: ``` 1 out of about 3 chunks balanced (9 considered), 67% left ``` but it seems to be stuck there as well. ``` # ps auxf | grep 'btrfs' root 795 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-worker] root 796 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-worker-hi] root 797 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-delalloc] root 798 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-flush_del] root 799 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-cache] root 800 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-fixup] root 801 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-endio] root 802 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-endio-met] root 803 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-endio-met] root 804 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-endio-rai] root 805 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-endio-rep] root 806 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-rmw] root 807 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-endio-wri] root 808 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-freespace] root 809 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-delayed-m] root 810 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-readahead] root 811 0.0 0.0 0 0 ? I< Mar01 0:00 \_ [btrfs-qgroup-re] root 813 0.0 0.0 0 0 ? S Mar01 0:00 \_ [btrfs-cleaner] root 814 0.0 0.0 0 0 ? S Mar01 0:01 \_ [btrfs-transacti] root 24170 1.2 0.0 0 0 ? I 10:35 1:52 \_ [kworker/u8:8-btrfs-endio-write] root 25435 1.6 0.0 0 0 ? I 11:33 1:30 \_ [kworker/u8:10-btrfs-endio] root 25841 1.5 0.0 0 0 ? I 11:54 1:06 \_ [kworker/u8:3-btrfs-endio] root 3301 1.4 0.0 0 0 ? I 12:26 0:34 \_ [kworker/u8:0-btrfs-endio-meta] root 4311 1.1 0.0 0 0 ? I 12:33 0:22 \_ [kworker/u8:11-btrfs-endio-meta] root 5468 1.6 0.0 0 0 ? I 12:47 0:17 \_ [kworker/u8:5-btrfs-freespace-write] root 5764 1.4 0.0 0 0 ? I 12:56 0:08 \_ [kworker/u8:6-btrfs-endio-write] root 5936 0.0 0.0 0 0 ? I 13:01 0:00 \_ [kworker/u8:7-btrfs-endio-meta] root 5938 0.0 0.0 0 0 ? I< 13:01 0:00 \_ [kworker/u9:0-btrfs-worker-high] root 6421 0.0 0.0 8684 812 pts/5 S+ 13:06 0:00 | \_ grep --color=auto btrfs root 20803 0.0 0.0 10164 816 ? Ss 09:32 0:00 /usr/bin/flock /run/btrfs-maintenance-running /usr/share/btrfsmaintenance/btrfs-balance.sh root 20804 0.0 0.0 16404 3056 ? S 09:32 0:00 \_ /bin/sh /usr/share/btrfsmaintenance/btrfs-balance.sh root 20832 0.0 0.0 16404 2472 ? S 09:32 0:00 \_ /bin/sh /usr/share/btrfsmaintenance/btrfs-balance.sh root 20926 11.8 0.0 16100 584 ? D 09:34 25:06 | \_ btrfs balance start -v -dusage 40 / root 20833 0.0 0.0 16404 2196 ? S 09:32 0:00 \_ /bin/sh /usr/share/btrfsmaintenance/btrfs-balance.sh linux-28d6:/home/okurz # cat /proc/20926/stack [<0>] wait_on_page_bit+0x12f/0x220 [<0>] __filemap_fdatawait_range+0x82/0xe0 [<0>] filemap_fdatawait_range+0xe/0x20 [<0>] __btrfs_wait_marked_extents.isra.0+0xc2/0x100 [btrfs] [<0>] btrfs_write_and_wait_transaction.isra.0+0x67/0xd0 [btrfs] [<0>] btrfs_commit_transaction+0x716/0xa00 [btrfs] [<0>] prepare_to_merge+0x206/0x240 [btrfs] [<0>] relocate_block_group+0x3bc/0x650 [btrfs] [<0>] btrfs_relocate_block_group+0x161/0x2f0 [btrfs] [<0>] btrfs_relocate_chunk+0x25/0x80 [btrfs] [<0>] __btrfs_balance+0x401/0xa10 [btrfs] [<0>] btrfs_balance+0x380/0x540 [btrfs] [<0>] btrfs_ioctl_balance+0x28f/0x340 [btrfs] [<0>] btrfs_ioctl+0x477/0x2790 [btrfs] [<0>] do_vfs_ioctl+0x461/0x6d0 [<0>] ksys_ioctl+0x5e/0x90 [<0>] __x64_sys_ioctl+0x16/0x20 [<0>] do_syscall_64+0x5a/0x1c0 [<0>] entry_SYSCALL_64_after_hwframe+0x49/0xbe ``` Reproduced multiple times on this machine so far. -- You are receiving this mail because: You are on the CC list for the bug.