| | |
|---|---|
| base of every series | `0c48d26d46bd` ("btrfs: stop reading free space inodes from the commit root"), the misc-next lane base (`misc-next/testing^1`) |
-| integration branch | `misc-next/testing` `02806563b90a` (octopus of all 19 topics) |
-| lane head | `zygo-misc-next-zb64` `7278042598d8`; its own commits on top of `testing` (kernel configs, `covers/`) are not exported |
+| integration branch | `misc-next/testing` `ca79d0a74875` (octopus of all 19 topics) |
+| lane head | `zygo-misc-next-zb64` `62a9fa73e0c9`; its own commits on top of `testing` (kernel configs, `covers/`) are not exported |
The base is not a published commit: the lane rebuilds it from
btrfs/for-next plus David Sterba's queue. It lives in the
| `prealloc-size` | 1 | `93d225865ab2` | Zygo | new, 0/1 (drafted 2026-10-18) | |
| `raid56-fixes` | 12 | `f7e693d10be2` | Zygo | new; replaces `covers/raid56-rbio-fixes.txt` (2 of these patches) | **patch 12 is DO-NOT-UPSTREAM** (rbio cache size debug knob) |
| `raid56-scrub-replace` | 13 | `9970d7e44abf` | Filipe Manana, Zygo | new | patch 1 is Filipe's, already in btrfs/for-next (`ec0795c045c3`) |
-| `stripe-alloc` | 114 | `bcadbfc8ac02` | Zygo | rewritten 2026-10-22 by subtopic (rebuild planned, REORDER-PLAN.md) | RFC; subtopic 6 (debug) not for merging; stripe_meta may be dropped (STRIPE-META-CLAIMS.md) |
+| `stripe-alloc` | 116 | `a23064467620` | Zygo | rewritten 2026-10-22 by subtopic (rebuild planned, REORDER-PLAN.md) | RFC; subtopic 6 (debug) not for merging; stripe_meta may be dropped (STRIPE-META-CLAIMS.md) |
| `low-space` | 3 | `4f26c7c44896` | Zygo | from misc-next `covers/`, patch 3 paragraph added 2026-10-22 | reserve off by default; patch 3 fixes an upstream relocation abort (FLUSH_LIMIT merge refill) |
| `dedupe-mtime` | 1 | `288d851bbbc2` | Ivan Kozik | new, 0/1 (drafted 2026-10-18) | Ivan's patch |
| `dm-stripfault` | 2 | `9ab63d7ab0fa` | Zygo | new | **test fixtures, NOT for merge** (no `To:`) |
- `balance-resume` patch 3 is offered for rejection, as its cover letter
says.
- Re-export with `scripts/export.sh` after any lane change. The
- directories reflect the lane at `misc-next/testing` `02806563b90a`.
+ directories reflect the lane at `misc-next/testing` `ca79d0a74875`.
Commit the result with the misc-next SHAs that the script prints.
bool "Btrfs experimental features"
depends on BTRFS_FS
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
-index d908efc9a3b4265ec1fe10c0f6bc157483ba3170..b4a342b85b08a9a3893f53b63b5970dce1290a8c 100644
+index 59f668359df7b6ccbb85dd632eee6858250a2993..e0862c13efafaed76b7c5aa606dd94179ac80500 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -3511,6 +3511,8 @@ void btrfs_retire_open_stripes(struct btrfs_fs_info *fs_info,
/*
* The stripe_alloc gate admitted writers against whole
-@@ -7068,7 +7083,15 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
+@@ -7198,7 +7213,15 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
mutex_unlock(&fs_info->ro_block_group_mutex);
btrfs_end_transaction(trans);
btrfs_bg_unblock_nocow(cache);
return ret;
}
-@@ -7096,6 +7119,7 @@ void btrfs_dec_block_group_ro(struct btrfs_block_group *cache)
+@@ -7226,6 +7249,7 @@ void btrfs_dec_block_group_ro(struct btrfs_block_group *cache)
sinfo->bytes_readonly -= btrfs_block_group_available_space(cache);
list_del_init(&cache->ro_list);
became_rw = true;
}
spin_unlock(&cache->lock);
spin_unlock(&sinfo->lock);
-@@ -8703,6 +8727,30 @@ static bool reloc_reserve_wanted(struct btrfs_fs_info *fs_info,
+@@ -8833,6 +8857,30 @@ static bool reloc_reserve_wanted(struct btrfs_fs_info *fs_info,
return READ_ONCE(sinfo->reloc_reserve);
}
* @bg left the reserve to go read-only and is writable again (or never went
* read-only): rejoin, unless the reserve is off. A surplus this makes is
diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
-index 8438b3d1d0bbf00a68da4555f6b7b2050a840d89..8a4357e22432ef45e50661f46ff8c324cb81e3a5 100644
+index c1aae3e1e396b859c368b0a1a1fe3f9e1000cf69..099df2453aa8e3093fc22da48a235c4877c19899 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -163,6 +163,16 @@ enum btrfs_block_group_flags {
ticket.reloc = reloc;
ticket.mount_cleanup =
diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h
-index 9fd81c739adbda3c50549a91fcf0796ee5723d2b..0a9b63ca7f6e1797f6ea53b82541df65db51eb30 100644
+index 0ee5b52a8296bea97ab82afd153dbd9cd69777d0..af2eb0c3f9a17207fbb20a0a9b83cd3106f5d297 100644
--- a/fs/btrfs/space-info.h
+++ b/fs/btrfs/space-info.h
-@@ -365,7 +365,7 @@ static inline u64 btrfs_space_info_used(const struct btrfs_space_info *s_info,
+@@ -382,7 +382,7 @@ static inline u64 btrfs_space_info_used(const struct btrfs_space_info *s_info,
return s_info->bytes_used + s_info->bytes_reserved +
s_info->bytes_pinned + s_info->bytes_readonly +
s_info->bytes_stripe_margin +
s_info->bytes_stripe_reserve +
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
-index b103da91cf8f06231f3190f89b1377fc804500a8..613bb14a46cf538f5a308310e09f5245ac031920 100644
+index 9aaa51a6734bb814620155960de1be76019ed7a8..161ee904e12c2dc442438ccea295332c3baa2bad 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -616,6 +616,8 @@ BTRFS_ATTR(debug_mount, stripe_rmw_audit_stats,
SPACE_INFO_ATTR(disk_used);
SPACE_INFO_ATTR(disk_total);
SPACE_INFO_ATTR(reclaim_count);
-@@ -2648,6 +2651,61 @@ static ssize_t btrfs_devinfo_type_store(struct kobject *kobj,
+@@ -2650,6 +2653,61 @@ static ssize_t btrfs_devinfo_type_store(struct kobject *kobj,
BTRFS_ATTR_RW(devid, type, btrfs_devinfo_type_show, btrfs_devinfo_type_store);
#endif /* CONFIG_BTRFS_ALLOCATOR_HINTS */
-From bcadbfc8ac020ccc7fddf79e5530322e3fb98747 Mon Sep 17 00:00:00 2001
+From a23064467620f3d39e4cc8c71b5ae12a9bab7572 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
-Date: Wed, 21 Oct 2026 03:28:20 -0400
-Subject: [RFC PATCH 000/114] btrfs: close the raid56 write hole for datacow with stripe-exclusive allocation
+Date: Thu, 22 Oct 2026 07:29:47 -0400
+Subject: [RFC PATCH 000/116] btrfs: close the raid56 write hole for datacow with stripe-exclusive allocation
To: linux-btrfs@vger.kernel.org
[RFC draft. The series is described by subtopic, in the order the
Subtopic 3: stripe-only reclaim
===============================
-Patches (6): 42, 46, 47, 70, 113, 114.
+Patches (8): 42, 46, 47, 70, 113-116.
Trapped stripe tails accumulate until something relocates their group.
The stock reclaim trigger keys on used bytes, so it never sees them.
off unless enabled through dynamic debug. It was asked for as a
production diagnostic ("a log message for reclaim that can be enabled
through dynamic_printk"), so it is placed here, not in subtopic 6.
+- Backoff after ENOSPC (115). Three relocations in a row that fail
+ with ENOSPC in one space_info stop reclaim there for 10 minutes.
+ Reclaim resumes early when a chunk is added or removed, or when free
+ space grows by what the last failed group held. A group that failed
+ with ENOSPC is not requeued. The room check also requires metadata
+ room for relocation's up-front reservation.
+- Sharing the exclusive operation (116). The worker holds the balance
+ exclusive operation, and a long reclaim list used to hold it for the
+ whole list: a queued balance, replace or resize waited up to 655 s in
+ testing. The worker now releases it after each group and waits 12 s
+ (BTRFS_RECLAIM_GAP) before the next. btrfs-progs checks sysfs
+ exclusive_operation before calling the ioctl, and with --enqueue it
+ sleeps 1-10 s after the notification, so only a gap lets it in; the 12
+ s covers that sleep. A direct ioctl caller refused while the worker
+ holds the operation makes it stand aside for 60 s after its current
+ group. In three traced runs, the longest queued wait fell from 184,
+ 176 and about 655 s to 82, 11 and 23 s, at 10-13 groups per 10
+ minutes either way. A waiter can still wait behind one long group.
These paths also serve subtopic 5's metadata groups.
- stripe_reclaim_now (write-only): "all" (or "1") queues every group the
reclaim predicate picks, ignoring the hysteresis; a block group's
logical start reclaims that group whatever its trapped space.
+- allocation/<type>/reclaim_backoffs (read-only): how many times reclaim
+ backed off after ENOSPC.
- echo 'file fs/btrfs/block-group.c format "reclaim: " +p' \
> /sys/kernel/debug/dynamic_debug/control
The harness, logs and test catalog are available on request.
-Zygo Blaxell (114):
+Zygo Blaxell (116):
btrfs: add btrfs_claim_free_stripe_run() for stripe-exclusive
allocation
btrfs: add open stripe run tracking for stripe-exclusive allocation
btrfs: log block group reclaim at debug level
btrfs: stripe_alloc: add stripe_reclaim_now to reclaim stripes on
demand
+ btrfs: stripe_alloc: back off block group reclaim after repeated
+ ENOSPC
+ btrfs: stripe_alloc: let queued exclusive operations in between
+ reclaims
- fs/btrfs/block-group.c | 3855 ++++++++++++++++++++++++++++-
- fs/btrfs/block-group.h | 313 ++-
+ fs/btrfs/block-group.c | 3993 ++++++++++++++++++++++++++++-
+ fs/btrfs/block-group.h | 314 ++-
fs/btrfs/block-rsv.c | 9 +-
fs/btrfs/btrfs_inode.h | 53 +
fs/btrfs/defrag.c | 161 ++
fs/btrfs/extent-tree.h | 23 +-
fs/btrfs/extent_io.c | 18 +
fs/btrfs/file.c | 74 +-
- fs/btrfs/free-space-cache.c | 1291 +++++++++-
+ fs/btrfs/free-space-cache.c | 1323 +++++++++-
fs/btrfs/free-space-cache.h | 21 +
- fs/btrfs/fs.h | 271 ++
+ fs/btrfs/fs.c | 29 +
+ fs/btrfs/fs.h | 287 +++
fs/btrfs/inode.c | 124 +-
fs/btrfs/messages.c | 3 +
fs/btrfs/ordered-data.c | 84 +
fs/btrfs/relocation.c | 302 ++-
fs/btrfs/relocation.h | 2 +-
fs/btrfs/space-info.c | 339 ++-
- fs/btrfs/space-info.h | 70 +-
+ fs/btrfs/space-info.h | 87 +-
fs/btrfs/super.c | 42 +
- fs/btrfs/sysfs.c | 426 ++++
+ fs/btrfs/sysfs.c | 428 ++++
fs/btrfs/tests/btrfs-tests.c | 6 +
fs/btrfs/tests/free-space-tests.c | 490 ++++
fs/btrfs/transaction.c | 74 +
fs/btrfs/zoned.c | 10 -
fs/btrfs/zoned.h | 3 -
include/trace/events/btrfs.h | 60 +
- 41 files changed, 10321 insertions(+), 129 deletions(-)
+ 42 files changed, 10552 insertions(+), 133 deletions(-)
base-commit: 0c48d26d46bdd6422bb91ba7f1c519a2993116dc
From f8aefd3a65eef1fc6ca498e3f7d34fd24bd2d1aa Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:26 -0400
-Subject: [RFC PATCH 001/114] btrfs: add btrfs_claim_free_stripe_run() for
+Subject: [RFC PATCH 001/116] btrfs: add btrfs_claim_free_stripe_run() for
stripe-exclusive allocation
To: linux-btrfs@vger.kernel.org
From e4a454e34f91c3246fb8a922f3e472b546622e33 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:26 -0400
-Subject: [RFC PATCH 002/114] btrfs: add open stripe run tracking for
+Subject: [RFC PATCH 002/116] btrfs: add open stripe run tracking for
stripe-exclusive allocation
To: linux-btrfs@vger.kernel.org
From a240872477979ccf01ce59b6481be002eac1d59d Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:26 -0400
-Subject: [RFC PATCH 003/114] btrfs: add the stripe_alloc allocation policy for
+Subject: [RFC PATCH 003/116] btrfs: add the stripe_alloc allocation policy for
raid56 data
To: linux-btrfs@vger.kernel.org
From 34e5adb74d1c65145b60d1a79aac6ba32cf9f5a2 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:26 -0400
-Subject: [RFC PATCH 004/114] btrfs: stripe_alloc: control the policy with a
+Subject: [RFC PATCH 004/116] btrfs: stripe_alloc: control the policy with a
filesystem property
To: linux-btrfs@vger.kernel.org
From f4900f9d5af6f1fcf7328e5c15eafef33ac4e37d Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:26 -0400
-Subject: [RFC PATCH 005/114] btrfs: report stripe run data IO through the
+Subject: [RFC PATCH 005/116] btrfs: report stripe run data IO through the
ordered extent lifecycle
To: linux-btrfs@vger.kernel.org
From dc05aa382bdb79b8f81db968b8d96236d5350ebb Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:26 -0400
-Subject: [RFC PATCH 006/114] btrfs: retire stripe runs at commit and gate
+Subject: [RFC PATCH 006/116] btrfs: retire stripe runs at commit and gate
stripe_alloc
To: linux-btrfs@vger.kernel.org
From c332d36b889a12ff768cdd448c5b31f72374837e Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:27 -0400
-Subject: [RFC PATCH 007/114] btrfs: add a write-hole invariant checker to the
+Subject: [RFC PATCH 007/116] btrfs: add a write-hole invariant checker to the
raid56 write path
To: linux-btrfs@vger.kernel.org
From ee439d57937755a384015dabef3bd5fea72283c7 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:27 -0400
-Subject: [RFC PATCH 008/114] btrfs: account stripe_alloc trapped free space
+Subject: [RFC PATCH 008/116] btrfs: account stripe_alloc trapped free space
for honest statfs
To: linux-btrfs@vger.kernel.org
From a3f76d9a2a78b3892650a7be8380d418b53e761a Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:27 -0400
-Subject: [RFC PATCH 009/114] btrfs: stripe_alloc: keep an open run per size
+Subject: [RFC PATCH 009/116] btrfs: stripe_alloc: keep an open run per size
band to trap less
To: linux-btrfs@vger.kernel.org
From 05efb9e0701c1438661bf6ac88349252b9a2c8ee Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:27 -0400
-Subject: [RFC PATCH 010/114] btrfs: stripe_alloc: grow the frontier run
+Subject: [RFC PATCH 010/116] btrfs: stripe_alloc: grow the frontier run
instead of stranding its tail
To: linux-btrfs@vger.kernel.org
From 19fdab82489824f188e6656c429f9f44d633c593 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:29 -0400
-Subject: [RFC PATCH 011/114] btrfs: raid56: batch stripe_alloc partial writes
+Subject: [RFC PATCH 011/116] btrfs: raid56: batch stripe_alloc partial writes
into full-stripe writes
To: linux-btrfs@vger.kernel.org
From d012dbc97bfc5dc275a789a7e3c464efa09851f6 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:30 -0400
-Subject: [RFC PATCH 012/114] btrfs: stripe_alloc: never claim stripes covered
+Subject: [RFC PATCH 012/116] btrfs: stripe_alloc: never claim stripes covered
by a live run
To: linux-btrfs@vger.kernel.org
From 14839547353dd2ff06d13c3a321b286878abf7c1 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:31 -0400
-Subject: [RFC PATCH 013/114] btrfs: stripe_alloc: settle a logged extent's
+Subject: [RFC PATCH 013/116] btrfs: stripe_alloc: settle a logged extent's
stripes at log commit
To: linux-btrfs@vger.kernel.org
From 36f2da531ea7492f5eadadcbcc1865d5e7bfec58 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:31 -0400
-Subject: [RFC PATCH 014/114] btrfs: stripe_alloc: private per-inode stripe
+Subject: [RFC PATCH 014/116] btrfs: stripe_alloc: private per-inode stripe
runs for log-active inodes
To: linux-btrfs@vger.kernel.org
From 720d3e3ab3b0c4ed892edddf9a210034a30dd06b Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:37 -0400
-Subject: [RFC PATCH 015/114] btrfs: stripe_alloc: carry an inode's log tail
+Subject: [RFC PATCH 015/116] btrfs: stripe_alloc: carry an inode's log tail
forward at fsync
To: linux-btrfs@vger.kernel.org
From bdc754626ebf4622fdb443bf7618eb55d626bf1c Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:38 -0400
-Subject: [RFC PATCH 016/114] btrfs: stripe_alloc: kick parked rbios before the
+Subject: [RFC PATCH 016/116] btrfs: stripe_alloc: kick parked rbios before the
fast fsync's writeback wait
To: linux-btrfs@vger.kernel.org
From a737dc4313e4b2f0d01d818cb220ae1b79682676 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:38 -0400
-Subject: [RFC PATCH 017/114] btrfs: raid56: pad sub-stripe writes to full
+Subject: [RFC PATCH 017/116] btrfs: raid56: pad sub-stripe writes to full
stripes in open runs
To: linux-btrfs@vger.kernel.org
From 56d65bde49a8f81bcbcbea7083ff885ceb6edeb7 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:39 -0400
-Subject: [RFC PATCH 018/114] btrfs: stripe_alloc: isolate nodatacow and
+Subject: [RFC PATCH 018/116] btrfs: stripe_alloc: isolate nodatacow and
preallocated extents by stripe
To: linux-btrfs@vger.kernel.org
From 7a2128a6af7b447537f4ce836354b9071f914cc4 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:40 -0400
-Subject: [RFC PATCH 019/114] btrfs: stripe_alloc: allow-rmw policy, and
+Subject: [RFC PATCH 019/116] btrfs: stripe_alloc: allow-rmw policy, and
write-in-place for isolated nocow extents
To: linux-btrfs@vger.kernel.org
From ff24d23dc643075ff828e20456e26b7fafb21566 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:41 -0400
-Subject: [RFC PATCH 020/114] btrfs: stripe_alloc: persist nocow runs across
+Subject: [RFC PATCH 020/116] btrfs: stripe_alloc: persist nocow runs across
commits and remounts
To: linux-btrfs@vger.kernel.org
From aee560fcabf96893e8ec946cfcb4693942e697c3 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:42 -0400
-Subject: [RFC PATCH 021/114] btrfs: raid56: do not park sync writes into nocow
+Subject: [RFC PATCH 021/116] btrfs: raid56: do not park sync writes into nocow
runs
To: linux-btrfs@vger.kernel.org
From 45a865e1a62c17737f0839e3178dd45790b9999a Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:43 -0400
-Subject: [RFC PATCH 022/114] btrfs: raid56: expose parking statistics in sysfs
+Subject: [RFC PATCH 022/116] btrfs: raid56: expose parking statistics in sysfs
To: linux-btrfs@vger.kernel.org
/sys/fs/btrfs/<uuid>/stripe_park_stats reports lifetime counters for
From a7895fde7eb406a254050d73cca1962ec84111e9 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:44 -0400
-Subject: [RFC PATCH 023/114] btrfs: raid56: skip parking for sync rbios
+Subject: [RFC PATCH 023/116] btrfs: raid56: skip parking for sync rbios
finished by their unplug batch
To: linux-btrfs@vger.kernel.org
From 807bda7889b06996e4506808acb3a7536a460d8d Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:45 -0400
-Subject: [RFC PATCH 024/114] btrfs: stripe_alloc: count open stripe run
+Subject: [RFC PATCH 024/116] btrfs: stripe_alloc: count open stripe run
remainders against data reservations
To: linux-btrfs@vger.kernel.org
From 697d334f1241e81347df4ce5a5eab5a7fa90352d Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:46 -0400
-Subject: [RFC PATCH 025/114] btrfs: stripe_alloc: pessimistic data reservation
+Subject: [RFC PATCH 025/116] btrfs: stripe_alloc: pessimistic data reservation
margin
To: linux-btrfs@vger.kernel.org
From b639bc5d11cf7bddb4d4237ab937eadad2f0a677 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:47 -0400
-Subject: [RFC PATCH 026/114] btrfs: stripe_alloc: claim fully-free stripes
+Subject: [RFC PATCH 026/116] btrfs: stripe_alloc: claim fully-free stripes
that span free space entries
To: linux-btrfs@vger.kernel.org
From 7a956b197fb633fae63d44cea3d3aba1ab518989 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:47 -0400
-Subject: [RFC PATCH 027/114] btrfs: stripe_alloc: warn when raid56 metadata is
+Subject: [RFC PATCH 027/116] btrfs: stripe_alloc: warn when raid56 metadata is
not covered
To: linux-btrfs@vger.kernel.org
From cde49689a8ca53fa1964cc93e1afc3ac5329368a Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:48 -0400
-Subject: [RFC PATCH 028/114] btrfs: stripe_alloc: report read-modify-write of
+Subject: [RFC PATCH 028/116] btrfs: stripe_alloc: report read-modify-write of
uncovered stripes
To: linux-btrfs@vger.kernel.org
From 3758928da147179fac4d9ecdbd3e6c703eda36d1 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:49 -0400
-Subject: [RFC PATCH 029/114] btrfs: raid56: say whether a metadata
+Subject: [RFC PATCH 029/116] btrfs: raid56: say whether a metadata
read-modify-write is a write hole
To: linux-btrfs@vger.kernel.org
From 9bd6e8e81e4445fb261378e2f6386fc195cfe535 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:50 -0400
-Subject: [RFC PATCH 030/114] btrfs: stripe_alloc: tunable park deadlines, and
+Subject: [RFC PATCH 030/116] btrfs: stripe_alloc: tunable park deadlines, and
say why padding declined
To: linux-btrfs@vger.kernel.org
From addef1dec9727eecb057bc479be793829bd049f7 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:51 -0400
-Subject: [RFC PATCH 031/114] btrfs: stripe_alloc: trace why padding declined,
+Subject: [RFC PATCH 031/116] btrfs: stripe_alloc: trace why padding declined,
at the moment it declined
To: linux-btrfs@vger.kernel.org
From ba78c5bdb23c33d2159470c5a0b11b182ab90aa8 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:52 -0400
-Subject: [RFC PATCH 032/114] btrfs: stripe_alloc: complete parked writes on
+Subject: [RFC PATCH 032/116] btrfs: stripe_alloc: complete parked writes on
allocation coverage, not clocks
To: linux-btrfs@vger.kernel.org
From 470e5e7b910d21431589778c95abc362bc6c1712 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:53 -0400
-Subject: [RFC PATCH 033/114] btrfs: stripe_alloc: track per-sector liveness
+Subject: [RFC PATCH 033/116] btrfs: stripe_alloc: track per-sector liveness
and pad from the map
To: linux-btrfs@vger.kernel.org
From 5eecaf54aa231b7e7a6bc68f5f16b905aee89bbb Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:54 -0400
-Subject: [RFC PATCH 034/114] btrfs: stripe_alloc: count claimable whole-stripe
+Subject: [RFC PATCH 034/116] btrfs: stripe_alloc: count claimable whole-stripe
supply directly
To: linux-btrfs@vger.kernel.org
From db091c0b27f9c41bde8be5b39e01f1dc63cf2a25 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:55 -0400
-Subject: [RFC PATCH 035/114] btrfs: raid56: adaptive park deadline from the
+Subject: [RFC PATCH 035/116] btrfs: raid56: adaptive park deadline from the
parked-rbio backlog
To: linux-btrfs@vger.kernel.org
From aff2aee44cbf33530bdb4578906ef260a084049d Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:56 -0400
-Subject: [RFC PATCH 036/114] btrfs: stripe_alloc: gate data admission on
+Subject: [RFC PATCH 036/116] btrfs: stripe_alloc: gate data admission on
claimable whole-stripe supply
To: linux-btrfs@vger.kernel.org
From 46fa2be98daec9cc359d0f216cd6725837f142b5 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:57 -0400
-Subject: [RFC PATCH 037/114] btrfs: stripe_alloc: cache a failed stripe run
+Subject: [RFC PATCH 037/116] btrfs: stripe_alloc: cache a failed stripe run
scan per block group
To: linux-btrfs@vger.kernel.org
From 4b4d6efe8d64cc91a3d94c7de469b449fa6cf16e Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:58 -0400
-Subject: [RFC PATCH 038/114] btrfs: stripe_meta: allocate tree blocks by whole
+Subject: [RFC PATCH 038/116] btrfs: stripe_meta: allocate tree blocks by whole
stripes
To: linux-btrfs@vger.kernel.org
From 4d8e0574bf5043d83a69e17e41ec1e48fbaea885 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:17:59 -0400
-Subject: [RFC PATCH 039/114] btrfs: stripe_alloc: drain the legacy allocator's
+Subject: [RFC PATCH 039/116] btrfs: stripe_alloc: drain the legacy allocator's
writes before arming the write-hole check at a runtime enable
To: linux-btrfs@vger.kernel.org
From 3962fc1138c917d8bef1818bc692eb54b7e6e501 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:00 -0400
-Subject: [RFC PATCH 040/114] btrfs: stripe_alloc: keep the admitted bytes
+Subject: [RFC PATCH 040/116] btrfs: stripe_alloc: keep the admitted bytes
placeable when a group goes read-only
To: linux-btrfs@vger.kernel.org
From 8fd5354672fd14d804216a575c2ec72e5ad6c950 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:01 -0400
-Subject: [RFC PATCH 041/114] btrfs: stripe_alloc: never let relocation wait on
+Subject: [RFC PATCH 041/116] btrfs: stripe_alloc: never let relocation wait on
the whole-stripe gate
To: linux-btrfs@vger.kernel.org
From 6cbe3c02a360975097941fd3a390fd607a3c9c1f Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:02 -0400
-Subject: [RFC PATCH 042/114] btrfs: stripe_alloc: give a queued stripe group a
+Subject: [RFC PATCH 042/116] btrfs: stripe_alloc: give a queued stripe group a
chunk to relocate into when the supply is short
To: linux-btrfs@vger.kernel.org
From 62886760223cf86cadcd40bfca85e7db871ef4f0 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:03 -0400
-Subject: [RFC PATCH 043/114] btrfs: stripe_alloc: charge relocation a margin
+Subject: [RFC PATCH 043/116] btrfs: stripe_alloc: charge relocation a margin
per reservation, not per extent
To: linux-btrfs@vger.kernel.org
From acf9c88ceacb8d92f6a5fbc83674f1d3196864c3 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:04 -0400
-Subject: [RFC PATCH 044/114] btrfs: stripe_alloc: keep the relocation group's
+Subject: [RFC PATCH 044/116] btrfs: stripe_alloc: keep the relocation group's
stripes out of the admission supply
To: linux-btrfs@vger.kernel.org
From 8907d8718d7362ec87fc3f669bb819a07b1a9f57 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:05 -0400
-Subject: [RFC PATCH 045/114] btrfs: stripe_alloc: let a data write fall back
+Subject: [RFC PATCH 045/116] btrfs: stripe_alloc: let a data write fall back
to the relocation group rather than drop
To: linux-btrfs@vger.kernel.org
From 1646d2e379cbc9675bd69a08ea24ba28af54c64d Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:06 -0400
-Subject: [RFC PATCH 046/114] btrfs: stripe_alloc: hand groups full of trapped
+Subject: [RFC PATCH 046/116] btrfs: stripe_alloc: hand groups full of trapped
free space to the reclaim worker
To: linux-btrfs@vger.kernel.org
From 15b5f3d5a5f85702371cb95182b011bfcf3754e6 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:06 -0400
-Subject: [RFC PATCH 047/114] btrfs: stripe_alloc: relocate a queued stripe
+Subject: [RFC PATCH 047/116] btrfs: stripe_alloc: relocate a queued stripe
group even while it has reserved or pinned bytes
To: linux-btrfs@vger.kernel.org
From 6c71f48b7ba8a42c9cf25656b8c5e199be0e22e8 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:07 -0400
-Subject: [RFC PATCH 048/114] btrfs: stripe_meta: maintain trapped free space
+Subject: [RFC PATCH 048/116] btrfs: stripe_meta: maintain trapped free space
for metadata groups like data
To: linux-btrfs@vger.kernel.org
From dcb5f0fbf44351d3d5ef2175b66c35649609deb8 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:08 -0400
-Subject: [RFC PATCH 049/114] btrfs: stripe_meta: back the global reserve with
+Subject: [RFC PATCH 049/116] btrfs: stripe_meta: back the global reserve with
usable stripes, and say when a tree block finds none
To: linux-btrfs@vger.kernel.org
From 04bca28a857b67ce23c2b2a8805cb17eca9bbd4b Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:12 -0400
-Subject: [RFC PATCH 050/114] btrfs: stripe_meta: hold back whole stripes so
+Subject: [RFC PATCH 050/116] btrfs: stripe_meta: hold back whole stripes so
tree blocks always land and trapped groups can be reclaimed
To: linux-btrfs@vger.kernel.org
From 7cff178b3a5b7d534853720b13afc9fb1021acbd Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:13 -0400
-Subject: [RFC PATCH 051/114] btrfs: stripe_meta: do not steal from the global
+Subject: [RFC PATCH 051/116] btrfs: stripe_meta: do not steal from the global
reserve below the relocation reserve
To: linux-btrfs@vger.kernel.org
From dafd9cfe4b2fdba8bea8b5293b466176a027531b Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:14 -0400
-Subject: [RFC PATCH 052/114] btrfs: stripe_meta: let the transaction
+Subject: [RFC PATCH 052/116] btrfs: stripe_meta: let the transaction
machinery's own reservations draw on the reserve
To: linux-btrfs@vger.kernel.org
From 4186b21d2136070c7e62e6ac601cb081752329c1 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:15 -0400
-Subject: [RFC PATCH 053/114] btrfs: stripe_meta: let a group go read-only for
+Subject: [RFC PATCH 053/116] btrfs: stripe_meta: let a group go read-only for
relocation against the reserve
To: linux-btrfs@vger.kernel.org
From a672e3917d47044aece23d6b98ff97c10ef29f16 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:16 -0400
-Subject: [RFC PATCH 054/114] btrfs: stripe_alloc: show per-group trapped bytes
+Subject: [RFC PATCH 054/116] btrfs: stripe_alloc: show per-group trapped bytes
in the space info dump
To: linux-btrfs@vger.kernel.org
From 7310972a63b8be7d9d744724270bf91f6e6f099b Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:17 -0400
-Subject: [RFC PATCH 055/114] btrfs: stripe_alloc: tell a dead tree block from
+Subject: [RFC PATCH 055/116] btrfs: stripe_alloc: tell a dead tree block from
a live one in the metadata RMW audit
To: linux-btrfs@vger.kernel.org
From 3ba7acf2e3c5e7ab07529aff1b016b49f0a8de40 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:18 -0400
-Subject: [RFC PATCH 056/114] btrfs: stripe_alloc: do not read an inline
+Subject: [RFC PATCH 056/116] btrfs: stripe_alloc: do not read an inline
backref off a keyed-ref extent item
To: linux-btrfs@vger.kernel.org
From 72db9e2da64153d2e8f18458e596483dab5902e5 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:19 -0400
-Subject: [RFC PATCH 057/114] btrfs: stripe_alloc: count whole stripes stranded
+Subject: [RFC PATCH 057/116] btrfs: stripe_alloc: count whole stripes stranded
behind live runs as trapped
To: linux-btrfs@vger.kernel.org
From 8d46931722459e4cace54fe7215127319d21744a Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:19 -0400
-Subject: [RFC PATCH 058/114] btrfs: stripe_alloc: give nocow extents a private
+Subject: [RFC PATCH 058/116] btrfs: stripe_alloc: give nocow extents a private
run only while they may be written in place
To: linux-btrfs@vger.kernel.org
From 3e051c111fc267a5cc6ba4d9697008d527787ebe Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:20 -0400
-Subject: [RFC PATCH 059/114] btrfs: stripe_alloc: count nocow run lifecycles
+Subject: [RFC PATCH 059/116] btrfs: stripe_alloc: count nocow run lifecycles
and stranded stripes in sysfs
To: linux-btrfs@vger.kernel.org
From e6d0215595c784679b9190d820a1ece1741b7bc0 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:21 -0400
-Subject: [RFC PATCH 060/114] btrfs: stripe_alloc: hold a stripe of margin
+Subject: [RFC PATCH 060/116] btrfs: stripe_alloc: hold a stripe of margin
across a preallocation
To: linux-btrfs@vger.kernel.org
From 9c3f5e2a5a7c2e6b251c0014c132b7341065a71f Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:22 -0400
-Subject: [RFC PATCH 061/114] btrfs: stripe_meta: carry raid56 metadata groups
+Subject: [RFC PATCH 061/116] btrfs: stripe_meta: carry raid56 metadata groups
through a runtime enable or disable
To: linux-btrfs@vger.kernel.org
From 6269c79f5f2d9e468f4bb02952cb0cef6dae89d4 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:23 -0400
-Subject: [RFC PATCH 062/114] btrfs: stripe_alloc: return a group's allocation
+Subject: [RFC PATCH 062/116] btrfs: stripe_alloc: return a group's allocation
cluster before scanning its stripes
To: linux-btrfs@vger.kernel.org
From ec648ceaf7412f288964cd2f969132a3c886478a Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:24 -0400
-Subject: [RFC PATCH 063/114] btrfs: stripe_alloc: release open stripe runs
+Subject: [RFC PATCH 063/116] btrfs: stripe_alloc: release open stripe runs
when a mount fails or an aborted filesystem unmounts
To: linux-btrfs@vger.kernel.org
From d7611f8eab54eddec75365914a085acbfe30808f Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 19 Sep 2026 13:18:25 -0400
-Subject: [RFC PATCH 064/114] btrfs: stripe_alloc: say at mount whether the
+Subject: [RFC PATCH 064/116] btrfs: stripe_alloc: say at mount whether the
policy is on
To: linux-btrfs@vger.kernel.org
From 5f54dd568678edd647946e21d412f18c0aa344a4 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sun, 20 Sep 2026 01:33:09 -0400
-Subject: [RFC PATCH 065/114] btrfs: stripe_meta: cover raid56 system chunks
+Subject: [RFC PATCH 065/116] btrfs: stripe_meta: cover raid56 system chunks
To: linux-btrfs@vger.kernel.org
The chunk tree lives in system chunks, which carry no METADATA bit, so the
From b57d7b9fd543eb50dcd6f234944b65cc5cc12eed Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Wed, 23 Sep 2026 01:47:12 -0400
-Subject: [RFC PATCH 066/114] btrfs: stripe_alloc: close dead nocow stripe runs
+Subject: [RFC PATCH 066/116] btrfs: stripe_alloc: close dead nocow stripe runs
at commit
To: linux-btrfs@vger.kernel.org
From be6877e4568053ef1d4b08e76f14ff5d7514345d Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Wed, 23 Sep 2026 15:30:45 -0400
-Subject: [RFC PATCH 067/114] btrfs: stripe_alloc: do not round a full stripe
+Subject: [RFC PATCH 067/116] btrfs: stripe_alloc: do not round a full stripe
with power-of-two macros
To: linux-btrfs@vger.kernel.org
From 24b8a9adadc5b04e224ff065efde5cde14e3e2a3 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Thu, 24 Sep 2026 02:21:12 -0400
-Subject: [RFC PATCH 068/114] btrfs: stripe_alloc: do not wait for stripe runs
+Subject: [RFC PATCH 068/116] btrfs: stripe_alloc: do not wait for stripe runs
to drain on an errored filesystem
To: linux-btrfs@vger.kernel.org
From 22e42d6d532311a8e03edbb8b36a73668ad6e173 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Thu, 24 Sep 2026 07:55:39 -0400
-Subject: [RFC PATCH 069/114] btrfs: stripe_alloc: end the commit-time and log
+Subject: [RFC PATCH 069/116] btrfs: stripe_alloc: end the commit-time and log
drains on an errored filesystem too
To: linux-btrfs@vger.kernel.org
From 9997aec01d002fa95fc96f0372fdab6f30f74882 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Tue, 29 Sep 2026 05:29:38 -0400
-Subject: [RFC PATCH 070/114] btrfs: stripe_alloc: compact mostly live groups
+Subject: [RFC PATCH 070/116] btrfs: stripe_alloc: compact mostly live groups
instead of skipping them
To: linux-btrfs@vger.kernel.org
From a4e8a846911c3922128fb10291ebf3a8113e0b09 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Wed, 30 Sep 2026 18:07:52 -0400
-Subject: [RFC PATCH 071/114] btrfs: stripe_alloc: attribute each data
+Subject: [RFC PATCH 071/116] btrfs: stripe_alloc: attribute each data
read-modify-write to why padding declined
To: linux-btrfs@vger.kernel.org
From e463b8e99b116061c0753e4af1e2aa570dec4222 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Wed, 30 Sep 2026 18:07:56 -0400
-Subject: [RFC PATCH 072/114] btrfs: stripe_alloc: optionally audit data
+Subject: [RFC PATCH 072/116] btrfs: stripe_alloc: optionally audit data
read-modify-writes against the committed extent tree
To: linux-btrfs@vger.kernel.org
From 44a1ac24083c094fe75d4a6f4eb9ed05b13af283 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Thu, 1 Oct 2026 00:57:50 -0400
-Subject: [RFC PATCH 073/114] btrfs: stripe_alloc: keep relocation's stripe
+Subject: [RFC PATCH 073/116] btrfs: stripe_alloc: keep relocation's stripe
runs until relocation ends
To: linux-btrfs@vger.kernel.org
From c0886d0274af757dfa3f0be8a04667ea3e62c481 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Thu, 1 Oct 2026 04:20:09 -0400
-Subject: [RFC PATCH 074/114] btrfs: stripe_alloc: let relocation allocate a
+Subject: [RFC PATCH 074/116] btrfs: stripe_alloc: let relocation allocate a
data chunk before it fails
To: linux-btrfs@vger.kernel.org
From ec70174eab1dd00bf3a251c225b0398b4bd8e490 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Thu, 1 Oct 2026 12:14:49 -0400
-Subject: [RFC PATCH 075/114] btrfs: stripe_alloc: keep a stripe in the rbio
+Subject: [RFC PATCH 075/116] btrfs: stripe_alloc: keep a stripe in the rbio
cache until its run has written all of it
To: linux-btrfs@vger.kernel.org
From 42d7b94bd97d9a38d48feb9f02a358654e5c4450 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 2 Oct 2026 02:41:44 -0400
-Subject: [RFC PATCH 076/114] btrfs: stripe_alloc: pad a stripe's allocated
+Subject: [RFC PATCH 076/116] btrfs: stripe_alloc: pad a stripe's allocated
sectors whose write is still to come
To: linux-btrfs@vger.kernel.org
From 2cf425545c69f0ec8986ea2d89e4aea793b853f4 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 3 Oct 2026 18:57:15 -0400
-Subject: [RFC PATCH 077/114] btrfs: stripe_alloc: apply the property before
+Subject: [RFC PATCH 077/116] btrfs: stripe_alloc: apply the property before
tree-log replay
To: linux-btrfs@vger.kernel.org
From 0e3f67ce778d663cc44348ec94ac9ef7962b170c Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sun, 4 Oct 2026 12:26:45 -0400
-Subject: [RFC PATCH 078/114] btrfs: stripe_alloc: count refused rbio pins and
+Subject: [RFC PATCH 078/116] btrfs: stripe_alloc: count refused rbio pins and
track rbio cache high water
To: linux-btrfs@vger.kernel.org
From d0d2b845edfcf2bcfc16d4a2562f087f8ee560ce Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sun, 4 Oct 2026 12:35:08 -0400
-Subject: [RFC PATCH 079/114] btrfs: stripe_alloc: sweep stale rbio pins, and
+Subject: [RFC PATCH 079/116] btrfs: stripe_alloc: sweep stale rbio pins, and
commit when live pins run low
To: linux-btrfs@vger.kernel.org
From d3436b335250591f54e6bd2c2413d7ca419d5071 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sun, 4 Oct 2026 17:46:19 -0400
-Subject: [RFC PATCH 080/114] btrfs: stripe_alloc: break rbio pins and open
+Subject: [RFC PATCH 080/116] btrfs: stripe_alloc: break rbio pins and open
stripe runs down by run class
To: linux-btrfs@vger.kernel.org
From 944f4a24fde392601ff2682d2eb6bc17281439f0 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sun, 4 Oct 2026 23:16:03 -0400
-Subject: [RFC PATCH 081/114] btrfs: stripe_alloc: give each log commit its own
+Subject: [RFC PATCH 081/116] btrfs: stripe_alloc: give each log commit its own
metadata stripe run
To: linux-btrfs@vger.kernel.org
From 6b52ac73acdfa4e81dc4e827b1b54ce8bc26ce25 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Mon, 5 Oct 2026 21:13:17 -0400
-Subject: [RFC PATCH 082/114] btrfs: stripe_alloc: don't make a parked rbio
+Subject: [RFC PATCH 082/116] btrfs: stripe_alloc: don't make a parked rbio
wait for sectors that will never be written
To: linux-btrfs@vger.kernel.org
From b0b570899c985d633a47d9dcb1144ccd2fda84e7 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Tue, 6 Oct 2026 00:11:38 -0400
-Subject: [RFC PATCH 083/114] btrfs: stripe_alloc: share LOG data runs per log
+Subject: [RFC PATCH 083/116] btrfs: stripe_alloc: share LOG data runs per log
transaction
To: linux-btrfs@vger.kernel.org
From edc9be873c6a389b67257aa21cf32bde2ae54133 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Tue, 6 Oct 2026 12:40:29 -0400
-Subject: [RFC PATCH 084/114] btrfs: stripe_alloc: let relocation allocate as
+Subject: [RFC PATCH 084/116] btrfs: stripe_alloc: let relocation allocate as
many data chunks as its reservation needs
To: linux-btrfs@vger.kernel.org
From 526336dd1cb564cd03541dc94f64468e79f1b779 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 00:17:47 -0400
-Subject: [RFC PATCH 085/114] btrfs: stripe_alloc: key private stripe runs by
+Subject: [RFC PATCH 085/116] btrfs: stripe_alloc: key private stripe runs by
subvolume and inode
To: linux-btrfs@vger.kernel.org
From 0249bfbd944033b29a18765023fefb579cba70df Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 00:49:17 -0400
-Subject: [RFC PATCH 086/114] btrfs: stripe_alloc: do not treat an allocation
+Subject: [RFC PATCH 086/116] btrfs: stripe_alloc: do not treat an allocation
error as a found extent
To: linux-btrfs@vger.kernel.org
From f1dcc0c8b7309bba72e1afcf78102c4c3ac2c5cf Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 00:50:45 -0400
-Subject: [RFC PATCH 087/114] btrfs: stripe_alloc: mark an ended ordered
+Subject: [RFC PATCH 087/116] btrfs: stripe_alloc: mark an ended ordered
extent's sectors written
To: linux-btrfs@vger.kernel.org
From 1453b4c48e63017f615c10544b4235189786cf97 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 00:51:15 -0400
-Subject: [RFC PATCH 088/114] btrfs: stripe_alloc: read the shared LOG run mode
+Subject: [RFC PATCH 088/116] btrfs: stripe_alloc: read the shared LOG run mode
once per log settle
To: linux-btrfs@vger.kernel.org
From 6ca617a49aa15b8ec9b8c7081d1eb2d7507f3f17 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 00:54:41 -0400
-Subject: [RFC PATCH 089/114] btrfs: stripe_alloc: remove only the set bits of
+Subject: [RFC PATCH 089/116] btrfs: stripe_alloc: remove only the set bits of
a bitmap when claiming a split run
To: linux-btrfs@vger.kernel.org
From 4601d72544d8953d695c8f433281690b56ef8c80 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 00:54:48 -0400
-Subject: [RFC PATCH 090/114] btrfs: stripe_alloc: claim a stripe tail in one
+Subject: [RFC PATCH 090/116] btrfs: stripe_alloc: claim a stripe tail in one
free space lock section
To: linux-btrfs@vger.kernel.org
From bbaa5b42965f3c3a970b39e326f3b6c1dfe9d04c Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 00:57:34 -0400
-Subject: [RFC PATCH 091/114] btrfs: stripe_alloc: keep the stripe totals
+Subject: [RFC PATCH 091/116] btrfs: stripe_alloc: keep the stripe totals
consistent with the groups during the commit scan
To: linux-btrfs@vger.kernel.org
From 3b6b54b00a4ed9c96d123c335c93e3114923d4b4 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 00:58:45 -0400
-Subject: [RFC PATCH 092/114] btrfs: stripe_alloc: do not delete an unused
+Subject: [RFC PATCH 092/116] btrfs: stripe_alloc: do not delete an unused
block group that still has stripe runs
To: linux-btrfs@vger.kernel.org
From ca3101c29dcae3ba3d91ba482cf52ec293a12252 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:00:24 -0400
-Subject: [RFC PATCH 093/114] btrfs: stripe_meta: commit before waiting for
+Subject: [RFC PATCH 093/116] btrfs: stripe_meta: commit before waiting for
metadata runs when making a group read-only
To: linux-btrfs@vger.kernel.org
From e3dbeeb1a01086b92143ecb56f6c1725a08dbd44 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:01:51 -0400
-Subject: [RFC PATCH 094/114] btrfs: raid56: do not read tree blocks under the
+Subject: [RFC PATCH 094/116] btrfs: raid56: do not read tree blocks under the
stripe lock in the metadata RMW audit
To: linux-btrfs@vger.kernel.org
From 35ac1b2bd14ce5778f590dbff49320ac7750f1fc Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:02:29 -0400
-Subject: [RFC PATCH 095/114] btrfs: raid56: stop the park timer before
+Subject: [RFC PATCH 095/116] btrfs: raid56: stop the park timer before
destroying the raid56 workqueue
To: linux-btrfs@vger.kernel.org
From 3bdfa7627870621a7dff695e25079fb4d77f86ca Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:02:46 -0400
-Subject: [RFC PATCH 096/114] btrfs: stripe_alloc: order the filesystem error
+Subject: [RFC PATCH 096/116] btrfs: stripe_alloc: order the filesystem error
before waking stripe drain waiters
To: linux-btrfs@vger.kernel.org
From 7ff9ffb31eedb49f8c241d91098520668eccd568 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:03:09 -0400
-Subject: [RFC PATCH 097/114] btrfs: raid56: set a padded rbio's data bitmap
+Subject: [RFC PATCH 097/116] btrfs: raid56: set a padded rbio's data bitmap
under bio_list_lock
To: linux-btrfs@vger.kernel.org
From 135c4cb527ac0bc0111b37dba64144b2cb73338a Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:05:05 -0400
-Subject: [RFC PATCH 098/114] btrfs: stripe_alloc: forget the failed-claim
+Subject: [RFC PATCH 098/116] btrfs: stripe_alloc: forget the failed-claim
verdict when a cluster returns its space
To: linux-btrfs@vger.kernel.org
From 298f642fc8d19cf79aa54bc8be36dfd0b9eafa43 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:05:32 -0400
-Subject: [RFC PATCH 099/114] btrfs: stripe_alloc: do not let a remount revert
+Subject: [RFC PATCH 099/116] btrfs: stripe_alloc: do not let a remount revert
the stripe_alloc property
To: linux-btrfs@vger.kernel.org
From 778a1ddcdd8631bd4727f83e0cb42c05db605b62 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:06:05 -0400
-Subject: [RFC PATCH 100/114] btrfs: stripe_alloc: do not block a NOWAIT write
+Subject: [RFC PATCH 100/116] btrfs: stripe_alloc: do not block a NOWAIT write
in the nocow stripe check
To: linux-btrfs@vger.kernel.org
From 5b09cd9ba9aeeafe54ca703dbc86bf8d7631ac1c Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:06:45 -0400
-Subject: [RFC PATCH 101/114] btrfs: stripe_alloc: keep the head of a claimed
+Subject: [RFC PATCH 101/116] btrfs: stripe_alloc: keep the head of a claimed
free space entry under the lock
To: linux-btrfs@vger.kernel.org
From c85af373e485e1318e807ed24e2637e2eeaff7a9 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:06:59 -0400
-Subject: [RFC PATCH 102/114] btrfs: stripe_meta: check the block group lookup
+Subject: [RFC PATCH 102/116] btrfs: stripe_meta: check the block group lookup
when freeing an unwritten tree block
To: linux-btrfs@vger.kernel.org
From 5571f78278ce68eb576cb4699b3163c73ee669aa Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:07:22 -0400
-Subject: [RFC PATCH 103/114] btrfs: stripe_alloc: remove the unused
+Subject: [RFC PATCH 103/116] btrfs: stripe_alloc: remove the unused
stripe_rmw_opt field
To: linux-btrfs@vger.kernel.org
From b10ebcd041372e1dcc2caf3f83d25d6507b9af56 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:16:09 -0400
-Subject: [RFC PATCH 104/114] btrfs: stripe_alloc: correct and trim the block
+Subject: [RFC PATCH 104/116] btrfs: stripe_alloc: correct and trim the block
group comments
To: linux-btrfs@vger.kernel.org
From 90f0201fde06e9443c9a760e358581ed631740a5 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 01:17:49 -0400
-Subject: [RFC PATCH 105/114] btrfs: stripe_alloc: correct and trim the
+Subject: [RFC PATCH 105/116] btrfs: stripe_alloc: correct and trim the
comments outside the block group code
To: linux-btrfs@vger.kernel.org
From bbc77261bfccfb82874222569e9b7f647e08ce5f Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 10:20:03 -0400
-Subject: [RFC PATCH 106/114] btrfs: stripe_meta: keep waiting for metadata
+Subject: [RFC PATCH 106/116] btrfs: stripe_meta: keep waiting for metadata
runs that do not drain at commit
To: linux-btrfs@vger.kernel.org
From 1fcae9e2ff2dfbc8b6f2514e9eb6b2fd4f8ef18f Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 11:19:42 -0400
-Subject: [RFC PATCH 107/114] btrfs: stripe_alloc: remove pad refusal reasons
+Subject: [RFC PATCH 107/116] btrfs: stripe_alloc: remove pad refusal reasons
that no longer exist
To: linux-btrfs@vger.kernel.org
From ddcc84d0004077983aec60e5e6cd948b25f58caf Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Fri, 9 Oct 2026 19:13:11 -0400
-Subject: [RFC PATCH 108/114] btrfs: stripe_alloc: count and log ordered
+Subject: [RFC PATCH 108/116] btrfs: stripe_alloc: count and log ordered
extents that end with sectors unwritten
To: linux-btrfs@vger.kernel.org
From 2c86e702355125e0779d667a08699cf34da557e9 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 10 Oct 2026 00:19:18 -0400
-Subject: [RFC PATCH 109/114] btrfs: stripe_alloc: skip RAID5/6 groups that are
+Subject: [RFC PATCH 109/116] btrfs: stripe_alloc: skip RAID5/6 groups that are
mapped as RAID1/RAID1C3
To: linux-btrfs@vger.kernel.org
From 3a14de399288d7d5aea4e241184b0be04e773a58 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sat, 10 Oct 2026 14:29:22 -0400
-Subject: [RFC PATCH 110/114] btrfs: stripe_alloc: count single-data-stripe
+Subject: [RFC PATCH 110/116] btrfs: stripe_alloc: count single-data-stripe
groups' free space in write admission
To: linux-btrfs@vger.kernel.org
From a1ba776d84f34898257042e6cc7e8426938c3453 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Sun, 11 Oct 2026 02:50:36 -0400
-Subject: [RFC PATCH 111/114] btrfs: stripe_alloc: account claimable stripes
+Subject: [RFC PATCH 111/116] btrfs: stripe_alloc: account claimable stripes
while a trim has them out
To: linux-btrfs@vger.kernel.org
From 52074eb4d12ef3850757554d6533f24cd258c362 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Tue, 20 Oct 2026 00:14:58 -0400
-Subject: [RFC PATCH 112/114] btrfs: stripe_alloc: do not miss bitmap free
+Subject: [RFC PATCH 112/116] btrfs: stripe_alloc: do not miss bitmap free
space when debiting a trim
To: linux-btrfs@vger.kernel.org
From 0900c2bcd6b290ba88d4bdea5d4f68477ad74aee Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Tue, 20 Oct 2026 13:04:19 -0400
-Subject: [RFC PATCH 113/114] btrfs: log block group reclaim at debug level
+Subject: [RFC PATCH 113/116] btrfs: log block group reclaim at debug level
To: linux-btrfs@vger.kernel.org
The reclaim worker relocates and compacts block groups without a word in
From bcadbfc8ac020ccc7fddf79e5530322e3fb98747 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Date: Tue, 20 Oct 2026 14:41:37 -0400
-Subject: [RFC PATCH 114/114] btrfs: stripe_alloc: add stripe_reclaim_now to
+Subject: [RFC PATCH 114/116] btrfs: stripe_alloc: add stripe_reclaim_now to
reclaim stripes on demand
To: linux-btrfs@vger.kernel.org
--- /dev/null
+From 43d8f35586e64dd7087aaa1c5979dcc993d05cf2 Mon Sep 17 00:00:00 2001
+From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
+Date: Thu, 22 Oct 2026 04:02:52 -0400
+Subject: [RFC PATCH 115/116] btrfs: stripe_alloc: back off block group reclaim
+ after repeated ENOSPC
+To: linux-btrfs@vger.kernel.org
+
+At the fill edge every reclaim of a stripe_alloc group fails with -ENOSPC,
+and the worker keeps retrying: a failed group goes back on the reclaim list
+at the end of each run (unless periodic reclaim is on) and is taken again
+at the next kick, and the commit-time rescan and the cleaner tick requeue
+trapped groups every five minutes each. Each attempt makes the group
+read-only, does part of the relocation and fails, all while holding the
+balance exclusive operation.
+
+It showed in two ways:
+
+ - The octopus P1 pass (raid5 6 x 3 GiB, misc-next, bhive 2026-10-20):
+ with the data space fully allocated and ~2 GiB trapped, reclaim held the
+ exclusive operation for over an hour of fsstress and long after it,
+ "error relocating chunk ...: -28" repeating (28 attempts, 13 errors in
+ one loop), so a resize could not start and the replace failed. The
+ worker sat in a metadata reservation (btrfs_block_rsv_refill under
+ relocate_block_group): metadata had no room either.
+
+ - reclaim-futile-test.sh (raid5 6 x 1 GiB at the edge, fsstress churn):
+ 226 reclaim errors in 600 s. Of the -28 returns, relocation's data
+ reservation lost the claimable stripes the room check had counted to
+ the concurrent writers.
+
+The room check (claimable stripes in the other groups) is an estimate
+taken when the group is queued, and it does not cover metadata. Make
+reclaim give up after reasonable effort instead of grinding:
+
+ - After BTRFS_RECLAIM_ENOSPC_STREAK (3) reclaims in a row fail with
+ -ENOSPC in a space_info, back off: the worker drops that space_info's
+ groups, and the rescan and tick do not queue them, until 10 minutes
+ pass, a chunk is added or removed, or the space_info's free space (free
+ in its groups plus unallocated) grows by what the last failed group
+ held. A group that failed with -ENOSPC is not put back on the list for
+ immediate retry. stripe_reclaim_now requests are still tried.
+ - The reclaim predicate also requires room for relocation's up-front
+ metadata reservation (512 tree blocks, twice RELOCATION_RESERVED_NODES):
+ the octopus failure was a metadata ENOSPC that the data-side check
+ could not see.
+ - /sys/fs/btrfs/<uuid>/allocation/<type>/reclaim_backoffs counts the
+ backoffs; the start of one is logged at debug level ("reclaim: ...").
+
+The occupancy of the exclusive operation at the fill edge, which the
+octopus also showed, is the next patch.
+
+Tested: reclaim-futile-test.sh measured 226 reclaim errors in 600 s on the
+lane without this patch (the fill-edge shape that loops; it does not loop
+on every run). With the patch no run logged more than 5 errors per 600 s;
+in one, five relocations failed with -ENOSPC and reclaim backed off once
+(reclaim_backoffs +1), then resumed. stripe-reclaim-test and
+stripe-reclaim-now-test pass.
+
+Assisted-by: Claude:claude-opus-5-5
+---
+ fs/btrfs/block-group.c | 97 ++++++++++++++++++++++++++++++++++++-
+ fs/btrfs/block-group.h | 1 +
+ fs/btrfs/free-space-cache.c | 34 ++++++++++++-
+ fs/btrfs/space-info.h | 17 +++++++
+ fs/btrfs/sysfs.c | 2 +
+ 5 files changed, 148 insertions(+), 3 deletions(-)
+
+diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
+index da9c005069b59..6368922e72c9d 100644
+--- a/fs/btrfs/block-group.c
++++ b/fs/btrfs/block-group.c
+@@ -5614,6 +5614,79 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
+ return ret;
+ }
+
++/*
++ * Reclaim gives up on a space_info for a while after this many reclaims in a
++ * row failed with -ENOSPC. Relocating or compacting a group needs room for
++ * its live data (and metadata reservations for moving it); at the fill edge
++ * there is none, every attempt fails after doing its work, and retrying each
++ * failed group on every worker run held the balance exclusive operation for
++ * over an hour while writers starved (octopus P1, bhive 2026-10-20).
++ */
++#define BTRFS_RECLAIM_ENOSPC_STREAK 3
++#define BTRFS_RECLAIM_BACKOFF (10 * 60 * HZ)
++
++/* Free space that a retried reclaim could use: free in groups, unallocated. */
++static u64 reclaim_free_bytes(const struct btrfs_space_info *space_info)
++{
++ return space_info->total_bytes - min(space_info->total_bytes,
++ space_info->bytes_used) +
++ atomic64_read(&space_info->fs_info->free_chunk_space);
++}
++
++/*
++ * Is reclaim backing off for this space_info? The backoff ends when its
++ * time is up, when a chunk was added or removed, or when free space grew by
++ * what the last failed group needed.
++ */
++bool btrfs_reclaim_backoff_active(struct btrfs_space_info *space_info)
++{
++ bool active = false;
++
++ spin_lock(&space_info->lock);
++ if (space_info->reclaim_backoff_until) {
++ active = time_before(jiffies, space_info->reclaim_backoff_until) &&
++ space_info->total_bytes == space_info->reclaim_backoff_total &&
++ reclaim_free_bytes(space_info) < space_info->reclaim_backoff_free;
++ if (!active) {
++ space_info->reclaim_backoff_until = 0;
++ space_info->reclaim_enospc_streak = 0;
++ }
++ }
++ spin_unlock(&space_info->lock);
++ return active;
++}
++
++/*
++ * Count a reclaim of @bg that failed with -ENOSPC (@enospc) or succeeded,
++ * and start the backoff at the end of a streak of failures. @need is what
++ * the group held: free space growing by that much ends the backoff early.
++ */
++static void reclaim_note_result(struct btrfs_block_group *bg, bool enospc, u64 need)
++{
++ struct btrfs_space_info *space_info = bg->space_info;
++ u32 streak;
++
++ spin_lock(&space_info->lock);
++ if (!enospc) {
++ space_info->reclaim_enospc_streak = 0;
++ spin_unlock(&space_info->lock);
++ return;
++ }
++ streak = ++space_info->reclaim_enospc_streak;
++ if (streak >= BTRFS_RECLAIM_ENOSPC_STREAK) {
++ space_info->reclaim_backoff_until = (jiffies + BTRFS_RECLAIM_BACKOFF) ?: 1;
++ space_info->reclaim_backoff_total = space_info->total_bytes;
++ space_info->reclaim_backoff_free = reclaim_free_bytes(space_info) +
++ max_t(u64, need, SZ_16M);
++ space_info->reclaim_backoffs++;
++ }
++ spin_unlock(&space_info->lock);
++ if (streak >= BTRFS_RECLAIM_ENOSPC_STREAK)
++ btrfs_debug(bg->fs_info,
++"reclaim: %u reclaims failed with ENOSPC (last block group %llu), backing off flags 0x%llx",
++ streak, bg->start, space_info->flags);
++}
++
+ void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info, unsigned int limit)
+ {
+ struct btrfs_block_group *bg;
+@@ -5653,6 +5726,7 @@ void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info, unsigned int limi
+ */
+ list_sort(NULL, &fs_info->reclaim_bgs, reclaim_bgs_cmp);
+ while (!list_empty(&fs_info->reclaim_bgs)) {
++ u64 need;
+ int ret;
+
+ bg = list_first_entry(&fs_info->reclaim_bgs,
+@@ -5662,10 +5736,27 @@ void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info, unsigned int limi
+
+ space_info = bg->space_info;
+ spin_unlock(&fs_info->unused_bgs_lock);
+- ret = btrfs_reclaim_block_group(bg, &reclaimed);
++ need = READ_ONCE(bg->used);
++ /*
++ * Backing off: drop the group rather than requeue it. The
++ * rescans and usage updates queue it again once reclaim may
++ * succeed. A stripe_reclaim_now request is tried regardless.
++ */
++ if (!READ_ONCE(bg->stripe_reclaim_forced) &&
++ btrfs_reclaim_backoff_active(space_info)) {
++ ret = 0;
++ } else {
++ int before = reclaimed;
++
++ ret = btrfs_reclaim_block_group(bg, &reclaimed);
++ if (ret == -ENOSPC || reclaimed > before)
++ reclaim_note_result(bg, ret == -ENOSPC, need);
++ }
+
++ /* An ENOSPC failure is not retried at once; see above. */
+ if ((btrfs_is_zoned(fs_info) && ret == -EAGAIN) ||
+- (ret && !READ_ONCE(space_info->periodic_reclaim)))
++ (ret && ret != -ENOSPC &&
++ !READ_ONCE(space_info->periodic_reclaim)))
+ btrfs_link_bg_list(bg, &retry_list);
+ btrfs_put_block_group(bg);
+
+@@ -5742,6 +5833,8 @@ static void btrfs_stripe_reclaim_tick(struct btrfs_fs_info *fs_info)
+ continue;
+ if (!btrfs_stripe_bg_wants_reclaim(bg))
+ continue;
++ if (btrfs_reclaim_backoff_active(sinfo))
++ break;
+ spin_lock(&bg->lock);
+ if (btrfs_mark_bg_to_reclaim(bg))
+ bg->stripe_reclaim_jiffies = jiffies ?: 1;
+diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
+index bc26b9e875506..115d8fa7369af 100644
+--- a/fs/btrfs/block-group.h
++++ b/fs/btrfs/block-group.h
+@@ -655,6 +655,7 @@ void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info, unsigned int limi
+ void btrfs_reclaim_bgs_work(struct work_struct *work);
+ void btrfs_reclaim_bgs(struct btrfs_fs_info *fs_info);
+ bool btrfs_mark_bg_to_reclaim(struct btrfs_block_group *bg);
++bool btrfs_reclaim_backoff_active(struct btrfs_space_info *space_info);
+ int btrfs_stripe_reclaim_now(struct btrfs_fs_info *fs_info, bool all, u64 start);
+ int btrfs_read_block_groups(struct btrfs_fs_info *info);
+ struct btrfs_block_group *btrfs_make_block_group(struct btrfs_trans_handle *trans,
+diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
+index f3a8381e05de5..414df924fbf8b 100644
+--- a/fs/btrfs/free-space-cache.c
++++ b/fs/btrfs/free-space-cache.c
+@@ -2413,6 +2413,33 @@ void btrfs_block_group_disarm_stripe_unusable(struct btrfs_block_group *bg)
+ * and queueing a group with nowhere to move it only costs writers read-only
+ * transitions. Counters are read unlocked; the worker re-checks.
+ */
++/*
++ * Relocation reserves metadata before it moves anything: 256 tree blocks
++ * up front (RELOCATION_RESERVED_NODES), doubled on its first shortfall. When
++ * the metadata space_info can neither hold nor overcommit that, relocating
++ * or compacting a data group fails with -ENOSPC after the group was made
++ * read-only, while the worker held the exclusive operation (octopus P1 at the
++ * fill edge, bhive 2026-10-20: the data side had room, metadata had none).
++ */
++#define STRIPE_RECLAIM_META_NODES 512
++
++static bool stripe_reclaim_meta_room(struct btrfs_fs_info *fs_info)
++{
++ struct btrfs_space_info *meta;
++ const u64 bytes = (u64)fs_info->nodesize * STRIPE_RECLAIM_META_NODES;
++
++ bool ok;
++
++ meta = btrfs_find_space_info(fs_info, BTRFS_BLOCK_GROUP_METADATA);
++ if (!meta)
++ return true;
++ spin_lock(&meta->lock);
++ ok = btrfs_space_info_used(meta, true) + bytes <= meta->total_bytes ||
++ btrfs_can_overcommit(meta, bytes, BTRFS_RESERVE_FLUSH_ALL, true);
++ spin_unlock(&meta->lock);
++ return ok;
++}
++
+ static enum stripe_reclaim_kind __stripe_bg_reclaim_kind(struct btrfs_block_group *bg,
+ int thresh, bool force,
+ bool check_room,
+@@ -2469,7 +2496,9 @@ static enum stripe_reclaim_kind __stripe_bg_reclaim_kind(struct btrfs_block_grou
+ READ_ONCE(sinfo->bytes_stripe_margin);
+ elsewhere -= min(elsewhere, READ_ONCE(bg->stripe_claimable));
+ elsewhere -= min(elsewhere, promised);
+- return elsewhere + extra_room >= need ? kind : STRIPE_RECLAIM_NONE;
++ if (elsewhere + extra_room < need)
++ return STRIPE_RECLAIM_NONE;
++ return stripe_reclaim_meta_room(bg->fs_info) ? kind : STRIPE_RECLAIM_NONE;
+ }
+
+ static enum stripe_reclaim_kind stripe_bg_reclaim_kind(struct btrfs_block_group *bg,
+@@ -2569,6 +2598,9 @@ void btrfs_block_group_rescan_stripe_unusable(struct btrfs_block_group *bg)
+ }
+ spin_unlock(&ctl->tree_lock);
+ kvfree(freep);
++ /* Reclaim backing off after ENOSPC: leave the group, the stamp too. */
++ if (reclaim && btrfs_reclaim_backoff_active(bg->space_info))
++ reclaim = false;
+ if (reclaim) {
+ /*
+ * Stamp the hysteresis only if the mark lands: a group still on
+diff --git a/fs/btrfs/space-info.h b/fs/btrfs/space-info.h
+index 4dea6081d5253..f959246fa007c 100644
+--- a/fs/btrfs/space-info.h
++++ b/fs/btrfs/space-info.h
+@@ -282,6 +282,23 @@ struct btrfs_space_info {
+ */
+ u64 reclaim_errors;
+
++ /*
++ * Reclaim backoff after -ENOSPC: once BTRFS_RECLAIM_ENOSPC_STREAK
++ * reclaims in a row failed for lack of space, the worker leaves this
++ * space_info's groups alone until reclaim_backoff_until passes, a chunk
++ * is added or removed (total_bytes leaves reclaim_backoff_total), or
++ * its free space reaches reclaim_backoff_free. Under ->lock.
++ */
++ unsigned long reclaim_backoff_until;
++ u64 reclaim_backoff_free;
++ u64 reclaim_backoff_total;
++ u32 reclaim_enospc_streak;
++ /*
++ * Monotonically increasing counter of reclaim backoffs
++ * Exposed in /sys/fs/<uuid>/allocation/<type>/reclaim_backoffs
++ */
++ u64 reclaim_backoffs;
++
+ /*
+ * If true, use the dynamic relocation threshold, instead of the
+ * fixed bg_reclaim_threshold.
+diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
+index 32d751fe87161..740eff72ee21e 100644
+--- a/fs/btrfs/sysfs.c
++++ b/fs/btrfs/sysfs.c
+@@ -889,6 +889,7 @@ SPACE_INFO_ATTR(disk_total);
+ SPACE_INFO_ATTR(reclaim_count);
+ SPACE_INFO_ATTR(reclaim_bytes);
+ SPACE_INFO_ATTR(reclaim_errors);
++SPACE_INFO_ATTR(reclaim_backoffs);
+ BTRFS_ATTR_RW(space_info, chunk_size, btrfs_chunk_size_show, btrfs_chunk_size_store);
+ BTRFS_ATTR(space_info, size_classes, btrfs_size_classes_show);
+
+@@ -1027,6 +1028,7 @@ static struct attribute *space_info_attrs[] = {
+ BTRFS_ATTR_PTR(space_info, reclaim_count),
+ BTRFS_ATTR_PTR(space_info, reclaim_bytes),
+ BTRFS_ATTR_PTR(space_info, reclaim_errors),
++ BTRFS_ATTR_PTR(space_info, reclaim_backoffs),
+ BTRFS_ATTR_PTR(space_info, periodic_reclaim),
+ #ifdef CONFIG_BTRFS_DEBUG
+ BTRFS_ATTR_PTR(space_info, force_chunk_alloc),
+--
+2.47.3
+
--- /dev/null
+From a23064467620f3d39e4cc8c71b5ae12a9bab7572 Mon Sep 17 00:00:00 2001
+From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
+Date: Thu, 22 Oct 2026 04:02:53 -0400
+Subject: [RFC PATCH 116/116] btrfs: stripe_alloc: let queued exclusive
+ operations in between reclaims
+To: linux-btrfs@vger.kernel.org
+
+The block group reclaim worker runs under the balance exclusive operation.
+At the fill edge, with writers active, each relocation or compaction takes
+tens of seconds (2 to 61 s measured) and the list keeps refilling, so the
+worker held the operation for most of the time writers ran: 84-90% of a
+600 s churn in reclaim-futile-test.sh, and for an hour of fsstress in the
+octopus P1 pass, where a resize and a replace could not start.
+
+btrfs-progs makes this worse than a plain refusal: before it calls the
+ioctl it reads sysfs exclusive_operation. Without --enqueue it gives up
+there; with --enqueue it waits for the notification that
+btrfs_exclop_finish() sends and then calls the ioctl. Either way the
+kernel never sees a refusal, and the worker retakes the operation right
+after each group, before a waiter can get in: on the lane a queued resize
+waited the whole churn (0 of 40 one-shot resizes succeeded, the longest
+refusal 601 s).
+
+Between groups, release the operation (btrfs_exclop_finish() sends the
+sysfs notification) and, if more groups are queued, leave it free for
+BTRFS_RECLAIM_GAP (12 s) before taking it back; if someone took it
+meanwhile, leave the rest of the list for a later run. 12 s comes from
+btrfs-progs: after the notification, check_running_fs_exclop() reopens
+the file and sleeps in a second select() for (remaining % 10) + 1 s "to
+randomize the order" before it re-reads the operation, so a waiter can
+take up to 10 s, plus wakeup latency under load, to get to the ioctl;
+with a 5 s gap about half the queued waiters woke after the worker had
+retaken the operation and waited another group. A progs change that
+re-reads right after the notification (and randomizes only when it loses
+a race) would allow a much shorter gap. With nobody waiting the gap
+costs only reclaim throughput: reclaim resumes after it.
+
+A caller that does reach btrfs_exclop_start() while the worker holds
+the operation (an ioctl user that does not pre-check sysfs) opens a
+BTRFS_RECLAIM_YIELD_WINDOW (60 s, longer than such a caller's retry
+interval and short next to the five-minute reclaim hysteresis) in which
+the worker neither starts nor takes another group. Both are backoffs
+only: no drain or accounting wait is bounded by them.
+
+A group in progress is not interrupted, so a queued operation waits for
+the rest of the current group plus at most one gap. Measured with
+reclaim-futile-test.sh (6 x 1 GiB raid5 at the fill edge, 128 MiB per
+member added, "all" written to stripe_reclaim_now, 600 s of fsstress, a
+no-op `btrfs filesystem resize` every 15 s and a `--enqueue` one every
+60 s), three traced runs per kernel:
+
+ without this patch: the worker held the operation for a whole sweep
+ (184, 176 and 616 s); the first queued resize waited 184, 176 and about
+ 655 s, i.e. for every queued group; one-shot resizes 27/40, 28/40, 0/40.
+
+ with it: every queued resize got in at the first hand-off after it
+ arrived (one sat through three short groups, 23 s), 0.3-9.4 s after the
+ worker's finish; longest queued waits 82, 11 and 23 s (the 82 s one sat
+ behind a single 127 s group); one-shot resizes 12/40, 31/40, 27/40.
+
+Reclaim kept its pace: 10, 10 and 14 groups per 10 minutes without the
+patch, 13, 11 and 10 with it.
+
+Assisted-by: Claude:claude-opus-5-5
+---
+ fs/btrfs/block-group.c | 41 +++++++++++++++++++++++++++++++++++++++--
+ fs/btrfs/fs.c | 29 +++++++++++++++++++++++++++++
+ fs/btrfs/fs.h | 16 ++++++++++++++++
+ 3 files changed, 84 insertions(+), 2 deletions(-)
+
+diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
+index 6368922e72c9d..d596cf1b563ea 100644
+--- a/fs/btrfs/block-group.c
++++ b/fs/btrfs/block-group.c
+@@ -5687,6 +5687,14 @@ static void reclaim_note_result(struct btrfs_block_group *bg, bool enospc, u64 n
+ streak, bg->start, space_info->flags);
+ }
+
++/* A refused operation's retry window is open: see btrfs_exclop_start(). */
++static bool reclaim_yielding(const struct btrfs_fs_info *fs_info)
++{
++ const unsigned long until = READ_ONCE(fs_info->reclaim_yield_until);
++
++ return until && time_before(jiffies, until);
++}
++
+ void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info, unsigned int limit)
+ {
+ struct btrfs_block_group *bg;
+@@ -5704,9 +5712,12 @@ void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info, unsigned int limi
+ if (!btrfs_should_reclaim(fs_info))
+ return;
+
++ if (reclaim_yielding(fs_info))
++ return;
++
+ guard(super_write)(fs_info->sb);
+
+- if (!btrfs_exclop_start(fs_info, BTRFS_EXCLOP_BALANCE))
++ if (!btrfs_exclop_start_reclaim(fs_info))
+ return;
+
+ /*
+@@ -5761,11 +5772,36 @@ void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info, unsigned int limi
+ btrfs_put_block_group(bg);
+
+ mutex_unlock(&fs_info->reclaim_bgs_lock);
++ /*
++ * Between groups, let a balance, replace or resize that is
++ * waiting for the exclusive operation have it: a long reclaim
++ * list must not lock them out for its whole run.
++ */
++ btrfs_exclop_finish(fs_info);
+ /*
+ * Reclaiming all the block groups in the list can take really
+ * long. Prioritize cleaning up unused block groups.
+ */
+ btrfs_delete_unused_bgs(fs_info);
++ /*
++ * Leave the exclusive operation free for a moment before the
++ * next group. btrfs-progs reads sysfs exclusive_operation
++ * before it calls the ioctl: without --enqueue it gives up
++ * there, and with it it waits for the notification that
++ * btrfs_exclop_finish() just sent. Either way the refusal
++ * never reaches btrfs_exclop_start(), so only a gap lets a
++ * balance, replace or resize in while the list is long.
++ */
++ if (!list_empty_careful(&fs_info->reclaim_bgs))
++ schedule_timeout_idle(BTRFS_RECLAIM_GAP);
++ /*
++ * Someone was refused the exclusive operation while we held
++ * it: leave the rest of the list to a run after their retry.
++ */
++ if (reclaim_yielding(fs_info))
++ goto out;
++ if (!btrfs_exclop_start_reclaim(fs_info))
++ goto out;
+ /*
+ * If we are interrupted by a balance, we can just bail out. The
+ * cleaner thread restart again if necessary.
+@@ -5779,10 +5815,11 @@ void btrfs_reclaim_block_groups(struct btrfs_fs_info *fs_info, unsigned int limi
+ spin_unlock(&fs_info->unused_bgs_lock);
+ mutex_unlock(&fs_info->reclaim_bgs_lock);
+ end:
++ btrfs_exclop_finish(fs_info);
++out:
+ spin_lock(&fs_info->unused_bgs_lock);
+ list_splice_tail(&retry_list, &fs_info->reclaim_bgs);
+ spin_unlock(&fs_info->unused_bgs_lock);
+- btrfs_exclop_finish(fs_info);
+ }
+
+ void btrfs_reclaim_bgs_work(struct work_struct *work)
+diff --git a/fs/btrfs/fs.c b/fs/btrfs/fs.c
+index 75a1217727a7b..9a36fbd24e318 100644
+--- a/fs/btrfs/fs.c
++++ b/fs/btrfs/fs.c
+@@ -183,6 +183,34 @@ bool btrfs_exclop_start(struct btrfs_fs_info *fs_info,
+ if (fs_info->exclusive_operation == BTRFS_EXCLOP_NONE) {
+ fs_info->exclusive_operation = type;
+ ret = true;
++ } else if (test_bit(BTRFS_FS_RECLAIM_EXCLOP, &fs_info->flags)) {
++ /*
++ * The block group reclaim worker holds it. It is background
++ * work: have it stand aside after its current group, long
++ * enough for the caller to retry.
++ */
++ WRITE_ONCE(fs_info->reclaim_yield_until,
++ (jiffies + BTRFS_RECLAIM_YIELD_WINDOW) ?: 1);
++ }
++ spin_unlock(&fs_info->super_lock);
++
++ return ret;
++}
++
++/*
++ * The block group reclaim worker's balance exclusive operation: marked as
++ * the worker's, so that an operation it refuses makes it yield (see
++ * btrfs_exclop_start()).
++ */
++bool btrfs_exclop_start_reclaim(struct btrfs_fs_info *fs_info)
++{
++ bool ret = false;
++
++ spin_lock(&fs_info->super_lock);
++ if (fs_info->exclusive_operation == BTRFS_EXCLOP_NONE) {
++ fs_info->exclusive_operation = BTRFS_EXCLOP_BALANCE;
++ set_bit(BTRFS_FS_RECLAIM_EXCLOP, &fs_info->flags);
++ ret = true;
+ }
+ spin_unlock(&fs_info->super_lock);
+
+@@ -222,6 +250,7 @@ void btrfs_exclop_finish(struct btrfs_fs_info *fs_info)
+ {
+ spin_lock(&fs_info->super_lock);
+ WRITE_ONCE(fs_info->exclusive_operation, BTRFS_EXCLOP_NONE);
++ clear_bit(BTRFS_FS_RECLAIM_EXCLOP, &fs_info->flags);
+ spin_unlock(&fs_info->super_lock);
+ sysfs_notify(&fs_info->fs_devices->fsid_kobj, NULL, "exclusive_operation");
+ }
+diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
+index d4688bb524eaf..485363059b1c7 100644
+--- a/fs/btrfs/fs.h
++++ b/fs/btrfs/fs.h
+@@ -241,6 +241,9 @@ enum {
+ */
+ BTRFS_FS_STRIPE_ALLOC_ENABLING,
+
++ /* The block group reclaim worker holds the exclusive operation. */
++ BTRFS_FS_RECLAIM_EXCLOP,
++
+ #if BITS_PER_LONG == 32
+ /* Indicate if we have error/warn message printed on 32bit systems */
+ BTRFS_FS_32BIT_ERROR,
+@@ -1116,6 +1119,13 @@ struct btrfs_fs_info {
+
+ /* Reclaim partially filled block groups in the background */
+ struct work_struct reclaim_bgs_work;
++ /*
++ * A balance, replace, resize or device add/remove was refused while
++ * the reclaim worker held the exclusive operation: until this jiffies
++ * value the worker neither starts nor takes another group, so that the
++ * caller's retry gets the operation.
++ */
++ unsigned long reclaim_yield_until;
+ /* Protected by unused_bgs_lock. */
+ struct list_head reclaim_bgs;
+ int bg_reclaim_threshold;
+@@ -1348,6 +1358,12 @@ static inline unsigned int btrfs_blocks_per_folio(const struct btrfs_fs_info *fs
+ }
+
+ bool __attribute_const__ btrfs_supported_blocksize(u32 blocksize);
++/* How long the reclaim worker stands aside after a refused operation. */
++#define BTRFS_RECLAIM_YIELD_WINDOW (60 * HZ)
++/* How long it leaves the exclusive operation free between two groups. */
++#define BTRFS_RECLAIM_GAP (12 * HZ)
++
++bool btrfs_exclop_start_reclaim(struct btrfs_fs_info *fs_info);
+ bool btrfs_exclop_start(struct btrfs_fs_info *fs_info,
+ enum btrfs_exclusive_operation type);
+ bool btrfs_exclop_start_try_lock(struct btrfs_fs_info *fs_info,
+--
+2.47.3
+
Source: misc-next/topics/stripe-alloc bcadbfc8ac02 (114 patches on
0c48d26d46bd). Zygo's requested order:
+[Lead, 2026-10-22: since this plan was written, two patches were appended
+(topic a23064467620, 116 patches). Both are subtopic 3 and go after old
+114: 115 "back off block group reclaim after repeated ENOSPC" and 116 "let
+queued exclusive operations in between reclaims". They touch only reclaim
+code (block-group.c/.h, free-space-cache.c, fs.c, fs.h, space-info.h, sysfs.c) and have no dependency
+on subtopics 4-6.]
+
1. Activation by xattr, basic no-RMW function
2. xattr to allow RMW for some operations
3. Stripe-only reclaim for data block groups
| `claimable-trim-miss-test.sh` (f-warn, Zygo's item 1, 2026-10-19) | a trim on a converted legacy raid5 debits every wholly free stripe it takes out: no "above scanned" WARN, and no over-count that the debug kernel's miss counter does not explain | 111 (+ candidate fix) | ~10 min per 300 s iteration | Instrumented #5 build. Fix off, no delay, 2 it: 30 missed debits, 0 WARN. Fix off, 500 ms delay, 3 it: FAIL, 30 WARNs, all explained. Fix on, same delay, 3 it: PASS, 0 WARN. Candidate kernel, 1 it, no delay: PASS (WARN count only). Acked data verifies in every run | 2026-10-19/20 | ehive fwarn #1-#3 (568c45b64012 + instrumentation); candidate zb64 bb9f4c113013 | f1c7f70 | forensics/f-warn-20261019/ |
| `stripe-reclaim-test.sh` with the reclaim debug lines (dynamic debug on / off) | patch 113's "reclaim: relocating|compacting / relocated|compacted block group" lines appear one per reclaim when enabled and not at all when not | 113 | 37 min (paced) / 8 min (unpaced) | PASS: on, misc-next: 19 start + 19 end lines, reclaim_count +19, 0 errors; off (RT_PACE=0): 0 lines, reclaim_count +15. 6.18: on 14 + 14, reclaim_count +14; off 0 lines, +12. (On 6.18 relocation already logs "relocating block group" at info level, so the script's reloc= counts it twice there; verdict unaffected) | 2026-10-21 | misc-next zb64 3e1390a9de03 + 113 + 114 (candidate); 6.18 zb64 68a671e005da + 113 + 114 | 92a2fd2 | forensics/f-oct-20261019/reclaim/seq1, seq618 |
| `stripe-reclaim-now-test.sh` | /sys/fs/btrfs/<uuid>/stripe_reclaim_now: "all" and a named group, the forced kind, the error codes | 114 | 15 min | PASS on both lanes: background reclaim off, nothing moves in 60 s; the least-used group relocated alone (reclaim_count +1); "all" queued 2, trapped 1256 -> 6 MiB; a 79%-used group with trapped stripes compacted; ENOENT, EINVAL (not a number, raid1 metadata group), EROFS, EAGAIN during a paused balance and a running replace; data verifies, no WARN, btrfs check clean. Not shown to fail without the patch (the knob does not exist there: exit 77) | 2026-10-21 | misc-next zb64 3e1390a9de03 + 113 + 114; 6.18 zb64 68a671e005da + 113 + 114 (candidates, promoted 2026-10-21) | 0d0cd25 | forensics/f-oct-20261019/reclaim/seq1/rn.log, seq618/rn.log |
-| `reclaim-futile-test.sh` (RF_FILL_RECLAIM=grow; 3 traced runs per kernel) | the reclaim worker at the fill edge: bounded ENOSPC retries, and a queued (`--enqueue`) resize/replace gets the exclusive operation between groups | reclaimbackoff candidate (2 patches after 114) | 30 min per run | Criterion changed 2026-10-22: "--enqueue wait <= 2 x longest reclaim group (measured per run)"; the old fixed 120 s figure is reported alongside. Lane without the patches (zb64 3e1390a9de03 + 113 + 114): the worker held the operation for a whole sweep (184, 176, 616 s); the first queued resize waited 184, 176, ~655 s (FUTILE, FUTILE, stuck); one-shot resizes 27/40, 28/40, 0/40; 10/10/14 groups per 10 min. Candidate (same + both patches, 12 s gap): every queued resize got in at the first hand-off after it arrived, 0.3-9.4 s after the finish; longest queued waits 82, 11, 23 s, limits 254/54/70 s (all within 120 s): BOUNDED x3; one-shot 12/40, 31/40, 27/40; 13/11/10 groups per 10 min; one ENOSPC backoff (5 errors, reclaim_backoffs +1). 6.18 candidate (zb64 7626a4a10198 + both): BOUNDED, longest queued wait 41 s (limit 122 s), one-shot 30/40, 8 groups per 10 min; stripe-reclaim-test and stripe-reclaim-now-test PASS there (the latter after its settle window was made longer than the 12 s gap, 8d999b3). Earlier (lane, first shape): 226 reclaim errors in 600 s | 2026-10-22 | misc-next zb64 3e1390a9de03 (+113, 114) vs that + the candidate (tree = refs/cand/reclaimbackoff/mn/zb64) | 9f79e62 | forensics/f-oct-20261019/reclaim/seqTA, seqTV |
+| `reclaim-futile-test.sh` (RF_FILL_RECLAIM=grow; 3 traced runs per kernel) | the reclaim worker at the fill edge: bounded ENOSPC retries, and a queued (`--enqueue`) resize/replace gets the exclusive operation between groups | 115, 116 (promoted 2026-10-22: misc-next zb64 62a9fa73e0c9, 6.18 zb64 23a47489479d) | 30 min per run | Criterion changed 2026-10-22: "--enqueue wait <= 2 x longest reclaim group (measured per run)"; the old fixed 120 s figure is reported alongside. Lane without the patches (zb64 3e1390a9de03 + 113 + 114): the worker held the operation for a whole sweep (184, 176, 616 s); the first queued resize waited 184, 176, ~655 s (FUTILE, FUTILE, stuck); one-shot resizes 27/40, 28/40, 0/40; 10/10/14 groups per 10 min. Candidate (same + both patches, 12 s gap): every queued resize got in at the first hand-off after it arrived, 0.3-9.4 s after the finish; longest queued waits 82, 11, 23 s, limits 254/54/70 s (all within 120 s): BOUNDED x3; one-shot 12/40, 31/40, 27/40; 13/11/10 groups per 10 min; one ENOSPC backoff (5 errors, reclaim_backoffs +1). 6.18 candidate (zb64 7626a4a10198 + both): BOUNDED, longest queued wait 41 s (limit 122 s), one-shot 30/40, 8 groups per 10 min; stripe-reclaim-test and stripe-reclaim-now-test PASS there (the latter after its settle window was made longer than the 12 s gap, 8d999b3). Earlier (lane, first shape): 226 reclaim errors in 600 s | 2026-10-22 | misc-next zb64 3e1390a9de03 (+113, 114) vs that + the candidate (tree = refs/cand/reclaimbackoff/mn/zb64) | 9f79e62 | forensics/f-oct-20261019/reclaim/seqTA, seqTV |
Negative controls (2026-10-19): one kernel, 568c45b64012 with patches 67,
99, 109, 110 and 111 reverted and patch 93's commit-before-wait removed
node's current event count, so a notify that lands between a select()
returning and the reopen is lost until the next notify or the 60 s
timeout. The kernel side works around (a) with a 12 s gap between
- reclaimed groups (reclaimbackoff candidate). Sketch of a progs fix:
+ reclaimed groups (patches 115-116). Sketch of a progs fix:
keep one fd open across the loop (kernfs poll compares the open file's
event count with the node's, so no notify is lost), re-read the
operation immediately after each notify and go straight to the ioctl