On Tue, Jan 26, 2016 at 2:48 PM, Karl Ove Hufthammer <karl@huftis.org> wrote:
Chris Murphy wrote:
[root@f23m images]# btrfs balance start -dusage=15 / Done, had to relocate 25 out of 54 chunks
This took about 20 seconds on an SSD.
I did something similar, ‘btrfs balance start -dusage=10’, on a HDD a few days ago. That took > 5 hours! And the disk wasn’t even close to full – around 80 GiB free (out of about 1,8 TiB).
Well that is in fact close to full, percentage wise. It's true that even 1% of such large drives these days translates into a lot of free space remaining, so the file system should still work, of course. But the fs+drive do write from outside to inside, and the inside performance dramatically less than the outside of the platters. The writes can be 50% slower. And if the files are above nodesize (16KiB by default) but are still small, and there are many of them, or if they are highly fragmented files, then it can take even longer to do the balance. It's also possible you've run into some kind of edge case bug. However, it's probably more of an optimization issue, rather than an overt bug. Before it could be fixed, it would need a lot of modeling: what's the current state of the file system on-disk (btrfs-image and/or btrfs-debug-tree), what is the workload at the time other than balance, what sorts of files are being balanced (harder to figure out), and then how to gather kernel data to see if there are unusual delays, i.e. sysrq + t while the balance is running slowly. And then a developer has to take an active interest in this information, and see about optimizing it. While it might seem they'd sooner choose to develop features, or do bug fixes, sometimes the optimization edge cases expose a problem that's causing other problems. So it's not a bad idea to have all the modeling information in a bug report. But, also keep in mind that even at 96% full the file system hasn't face planted! That's good. -- Chris Murphy -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org