RFC Introduce per-profile available space array to avoid over-confident can_overcommit()
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest3 patches 7 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | btrfs: Introduce per-profile available space facilityfs/ fs/ | +181 | 1 reply | |
| 2/3 | btrfs: Update per-profile available space when device size/used space get updatedfs/ | +15 | 2 replies | |
| 3/3 | btrfs: space-info: Use per-profile available space in can_overcommit()fs/ | +7 | 1 reply |
Reviews trailers per patch
2 of 3 patches have a Reviewed-by or Acked-by.
| Patch | Josef Bacik |
|---|---|
| 1/3 | R-b |
| 2/3 | |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH RFC 0/3] Introduce per-profile available space array to avoid over-confident can_overcommit()
There are several bug reports of ENOSPC error inbtrfs_run_delalloc_range().
With some extra info from one reporter, it turns out that can_overcommit() is using a wrong way to calculate allocatable metadata space.
The most typical case would look like:
devid 1 unallocated: 1G
devid 2 unallocated: 10G
metadata profile: RAID1
In above case, we can at most allocate 1G chunk for metadata, due to unbalanced disk free space.
But current can_overcommit() uses factor based calculation, which never consider the disk free space balance.
To address this problem, here comes the per-profile available space array, which gets updated every time a chunk get allocated/removed or a device get grown or shrunk.
This provides a quick way for hotter place like can_overcommit() to grab an estimation on how many bytes it can over-commit.
The per-profile available space calculation tries to keep the behavior of chunk allocator, thus it can handle uneven disks pretty well.
The RFC tag is here because I'm not yet confident enough about the implementation.
I'm not sure this is the proper to go, or just a over-engineered mess.
Qu Wenruo (3):
btrfs: Introduce per-profile available space facility
btrfs: Update per-profile available space when device size/used space
get updated
btrfs: space-info: Use per-profile available space in can_overcommit()
fs/btrfs/space-info.c | 15 ++-- fs/btrfs/volumes.c | 205 ++++++++++++++++++++++++++++++++++++++---- fs/btrfs/volumes.h | 10 +++ 3 files changed, 203 insertions(+), 27 deletions(-)
Signature · 1 line
2.24.1