|
|
Subscribe / Log in / New account

Fedora 16 to use Btrfs as its default filesystem

Fedora 16 to use Btrfs as its default filesystem

Posted Jun 10, 2011 20:14 UTC (Fri) by MisterIO (guest, #36192)
In reply to: Fedora 16 to use Btrfs as its default filesystem by masoncl
Parent article: Fedora 16 to use Btrfs as its default filesystem

yes, I remember that part. the way it is now, the space waste isn't limited, right? that is, it doesn't have an upper bound. wouldn't it be possible to say something like: if the space waste goes over a certain limit(a percentual of the total space), stop inlining file data, go back to using extents?


to post comments

Fedora 16 to use Btrfs as its default filesystem

Posted Jun 10, 2011 20:34 UTC (Fri) by masoncl (subscriber, #47138) [Link] (4 responses)

We have mount -o max_inline=, so the admin can control the max size that we choose to inline. The default is a little under 4KB, which works well most of the time. Usually we're able to get the inode, xattrs and file data all in the same block, so even for a 2KB file it works well.

The problem comes when they are all 2KB files, which is why we give the admin knobs.

For larger leaf sizes, we'll still have a limit of 4KB inlined in the btree, so the overall percentage will be a lot lower. With a 16KB leaf, 2KB inlined files won't be a problem.

-chris

Fedora 16 to use Btrfs as its default filesystem

Posted Jun 10, 2011 21:14 UTC (Fri) by MisterIO (guest, #36192) [Link] (1 responses)

As I see it, inlining file data is an optimization for small files, right? Big files use extents by default, right? So the obvious solution to the problem would be to say: if the percentual of wasted space is too high, stop optimizing for small files, treat all files as big files and just put file data on extents. Now, being this so obvious, it just means that, being a noob on fs programming, I can't see the obvious problem with that solution(maybe extreme performance degradation? maybe fragmentation? maybe both?), or maybe that it wouldn't be a solution at all.
Anyway, I appreciate that you took the time to explain this here.
It would be useful if larger leaf sizes could be used even on old btrfs filesystems(that is, I hope it's not an option to be specified at fs creation time).

Fedora 16 to use Btrfs as its default filesystem

Posted Jun 10, 2011 23:43 UTC (Fri) by masoncl (subscriber, #47138) [Link]

Part of the answer is just that maintaining an overall "how much space have we wasted number" is yet another metric to store and maintain, and it does tend to get tricky to count in the face of snapshots. So there's a real CPU cost involved.

But the main reason is that I prefer the filesystem be predictable. If your file size is less than a specific value, it goes into the btree. It's very simple to explain and isn't surprising ;)

Fedora 16 to use Btrfs as its default filesystem

Posted Jun 10, 2011 21:36 UTC (Fri) by jengelh (guest, #33263) [Link] (1 responses)

What makes "a little under 4KB" better than xfs's choice of 256 bytes? (Which itself I generally bumped to 512 on fses where a 'significant' amount of files may carry ACLs.)

Fedora 16 to use Btrfs as its default filesystem

Posted Jun 10, 2011 23:49 UTC (Fri) by masoncl (subscriber, #47138) [Link]

Better is a tricky word. 4KB is the smallest extent we'll allocate, so being able to allocate up to 4KB in the btree usually makes for less wasted space.

There are a lot of factors in play. No inline data means more inodes in a block, which means things that stat in bulk (or rm) tend to be faster.

But, inline data means that when we read the inode we have the data, so things like reading all the files in a directory tend to be faster.

-chris


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds