mbox series

[v2,0/4] btrfs: data block group size classes

Message ID cover.1668626092.git.boris@bur.io (mailing list archive)
Headers show
Series btrfs: data block group size classes | expand

Message

Boris Burkov Nov. 16, 2022, 7:22 p.m. UTC
This patch set introduces the notion of size classes to the block group
allocator for data block groups. This is specifically useful because the
first fit allocator tends to perform poorly when large extents free up
in older block groups and small writes suddenly shift there. Generally,
it should lead to slightly more predictable allocator behavior as the
gaps left by frees will be used by allocations of a similar size.

Details about the changes and performance testing are in the individual
commit messages.

The last two patches constitute the business of the change. One adds the
size classes and the other handles the fact that we don't want to
persist the size class, so we don't know it when we first load a block
group.
---
v2:
- removed 1G falloc extents patch
- rebased tracepoints patches onto significant header file refactor

Boris Burkov (4):
  btrfs: use ffe_ctl in btrfs allocator tracepoints
  btrfs: add more ffe tracepoints
  btrfs: introduce size class to block group allocator
  btrfs: load block group size class when caching

 fs/btrfs/block-group.c       | 234 ++++++++++++++++++++++++++++++++---
 fs/btrfs/block-group.h       |  15 ++-
 fs/btrfs/extent-tree.c       | 166 +++++++------------------
 fs/btrfs/extent-tree.h       |  81 ++++++++++++
 fs/btrfs/super.c             |   1 +
 include/trace/events/btrfs.h | 128 +++++++++++++++----
 6 files changed, 466 insertions(+), 159 deletions(-)

Comments

David Sterba Nov. 18, 2022, 4:56 p.m. UTC | #1
On Wed, Nov 16, 2022 at 11:22:01AM -0800, Boris Burkov wrote:
> This patch set introduces the notion of size classes to the block group
> allocator for data block groups. This is specifically useful because the
> first fit allocator tends to perform poorly when large extents free up
> in older block groups and small writes suddenly shift there. Generally,
> it should lead to slightly more predictable allocator behavior as the
> gaps left by frees will be used by allocations of a similar size.
> 
> Details about the changes and performance testing are in the individual
> commit messages.
> 
> The last two patches constitute the business of the change. One adds the
> size classes and the other handles the fact that we don't want to
> persist the size class, so we don't know it when we first load a block
> group.
> ---
> v2:
> - removed 1G falloc extents patch
> - rebased tracepoints patches onto significant header file refactor
> 
> Boris Burkov (4):
>   btrfs: use ffe_ctl in btrfs allocator tracepoints
>   btrfs: add more ffe tracepoints
>   btrfs: introduce size class to block group allocator
>   btrfs: load block group size class when caching

I'd take the first two patches as preparatory work but as commented the
ctree.h should be reworked so the whole patchset will go to next
development cycle.