public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] btrfs: sysfs: set / query btrfs stripe size
@ 2021-10-27 20:14 Stefan Roesch
  2021-10-27 20:14 ` [PATCH v2 1/4] btrfs: store stripe size and chunk size in space-info struct Stefan Roesch
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Stefan Roesch @ 2021-10-27 20:14 UTC (permalink / raw)
  To: linux-btrfs, kernel-team; +Cc: shr

Motivation:
The btrfs allocator is currently not ideal for all workloads. It tends
to suffer from overallocating data block groups and underallocating
metadata block groups. This results in filesystems becoming read-only
even though there is plenty of "free" space.

This is naturally confusing and distressing to users.

Patches:
1) Store the stripe and chunk size in the btrfs_space_info structure
2) Add a sysfs entry to expose the above information
3) Add a sysfs entry to force a space allocation
4) Increase the default size of the metadata chunk allocation to 5GB
   for volumes greater than 50GB.

Testing:
  A new test is being added to the xfstest suite. For reference the
  corresponding patch has the title:
    [PATCH] btrfs: Test chunk allocation with different sizes

  In addition also manual testing has been performed.
    - Run xfstests with the changes and the new test. It does not
      show new diffs.
    - Test with storage devices 10G, 20G, 30G, 50G, 60G
      - Default allocation
      - Increase of chunk size
      - If the stripe size is > the free space, it allocates
        free space - 1MB. The 1MB is left as free space.
      - If the device has a storage size > 50G, it uses a 5GB
        chunk size for new allocations.

Stefan Roesch (4):
  btrfs: store stripe size and chunk size in space-info struct.
  btrfs: expose stripe and chunk size in sysfs.
  btrfs: add force_chunk_alloc sysfs entry to force allocation
  btrfs: increase metadata alloc size to 5GB for volumes > 50GB

 fs/btrfs/space-info.c |  72 +++++++++++++++++++++
 fs/btrfs/space-info.h |   4 ++
 fs/btrfs/sysfs.c      | 145 ++++++++++++++++++++++++++++++++++++++++++
 fs/btrfs/volumes.c    |  28 +++-----
 4 files changed, 230 insertions(+), 19 deletions(-)

Signed-off-by: Stefan Roesch <shr@fb.com>
---
V2:
   - Split the patch in 4 patches
   - Added checks for zone volumes in sysfs.c
   - Replaced the BUG() with ASSERT()
   - Changed if with fallthrough
   - Removed comments in space-info.h
--
2.30.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-29  8:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-27 20:14 [PATCH v2 0/4] btrfs: sysfs: set / query btrfs stripe size Stefan Roesch
2021-10-27 20:14 ` [PATCH v2 1/4] btrfs: store stripe size and chunk size in space-info struct Stefan Roesch
2021-10-28 13:48   ` Josef Bacik
2021-10-27 20:14 ` [PATCH v2 2/4] btrfs: expose stripe and chunk size in sysfs Stefan Roesch
2021-10-27 20:14 ` [PATCH v2 3/4] btrfs: add force_chunk_alloc sysfs entry to force allocation Stefan Roesch
2021-10-27 20:14 ` [PATCH v2 4/4] btrfs: increase metadata alloc size to 5GB for volumes > 50GB Stefan Roesch
2021-10-28  1:14   ` Wang Yugui
2021-10-28 13:43 ` [PATCH v2 0/4] btrfs: sysfs: set / query btrfs stripe size Josef Bacik
2021-10-28 14:27   ` Josef Bacik
2021-10-28 15:00     ` Johannes Thumshirn
2021-10-29  3:11       ` Stefan Roesch
2021-10-29  8:31         ` Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox