On 8/5/19 5:41 PM, David Sterba wrote:
On Mon, Aug 05, 2019 at 04:10:39PM +0200, Holger Hoffstätte wrote:
On 8/5/19 3:19 PM, Josef Bacik wrote:
In testing block group removal it's sometimes handy to be able to create
block groups on demand. Add an ioctl to allow us to force allocation
from userspace.
Signed-off-by: Josef Bacik <jo...@toxicpanda.com>
---
v1->v2:
- I noticed last week when backporting this that btrfs_chunk_alloc doesn't
figure out the rest of the flags needed for the type. Use
btrfs_force_chunk_alloc instead so that we get the raid settings for the
alloc
type we're using.
Tested-by: Holger Hoffstätte <hol...@applied-asynchrony.com>
Now works as intended - very nice, thanks!
Tell me, are you interested in this ioctl because it was the missing bit
for testing or because the chunk allocator is so bad that you need a
command to make work?
Mostly curiosity. "To make [it] work" would be a bit strong - btrfs works
fine by now. But yes, slightly over-allocating both metadata and data
(both by ~1-2 chunks) helps esp. when there is a mix of small and large
files, and to reduce fragmentation of large files. That should not be
surprising.
-h