| | |
|---|---|
| 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` `5eed033e8449` (octopus of all 18 topics) |
-| lane head | `zygo-misc-next-zb64` `e2c9218febf9`; its own commits on top of `testing` (kernel configs, `covers/`) are not exported |
+| integration branch | `misc-next/testing` `12c700ee1440` (octopus of all 18 topics) |
+| lane head | `zygo-misc-next-zb64` `aa5e2b4c73c0`; 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` | 10 | `2a30d9423f4e` | Filipe Manana, Zygo | new | patch 1 is Filipe's, already in btrfs/for-next (`ec0795c045c3`) |
-| `stripe-alloc` | 112 | `52074eb4d12e` | Zygo | from misc-next `covers/`, **stale**: written for 65 patches, marked DO NOT SEND AS IS | RFC |
+| `stripe-alloc` | 114 | `bcadbfc8ac02` | Zygo | from misc-next `covers/`, **stale**: written for 65 patches, marked DO NOT SEND AS IS | RFC |
| `low-space` | 2 | `57034df182f0` | Zygo | from misc-next `covers/`, current | reserve off by default |
| `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` `5eed033e8449`.
+ directories reflect the lane at `misc-next/testing` `12c700ee1440`.
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 ce7727af7728c7ad9e3f0e5fb288dccb1fc9e753..77957a22428556aa1c30f04cfcf82859b7d3c961 100644
+index d908efc9a3b4265ec1fe10c0f6bc157483ba3170..b4a342b85b08a9a3893f53b63b5970dce1290a8c 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
-@@ -6896,7 +6911,15 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,
+@@ -7068,7 +7083,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;
}
-@@ -6924,6 +6947,7 @@ void btrfs_dec_block_group_ro(struct btrfs_block_group *cache)
+@@ -7096,6 +7119,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);
-@@ -8531,6 +8555,30 @@ static bool reloc_reserve_wanted(struct btrfs_fs_info *fs_info,
+@@ -8703,6 +8727,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 46150cd8ead04baa1890b626061e1183859c90f3..5f9a6a503b0ec7a4df30e8ef18b9f7ee321b0c44 100644
+index 8438b3d1d0bbf00a68da4555f6b7b2050a840d89..8a4357e22432ef45e50661f46ff8c324cb81e3a5 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -163,6 +163,16 @@ enum btrfs_block_group_flags {
s_info->bytes_stripe_margin +
s_info->bytes_stripe_reserve +
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
-index b715823b629ceac3b0702214adbc33066e6e0726..3651d1cdad99d241e2e18ec79d7f51611884f56f 100644
+index b103da91cf8f06231f3190f89b1377fc804500a8..613bb14a46cf538f5a308310e09f5245ac031920 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);
-@@ -2619,6 +2622,61 @@ static ssize_t btrfs_devinfo_type_store(struct kobject *kobj,
+@@ -2648,6 +2651,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 52074eb4d12ef3850757554d6533f24cd258c362 Mon Sep 17 00:00:00 2001
+From bcadbfc8ac020ccc7fddf79e5530322e3fb98747 Mon Sep 17 00:00:00 2001
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
-Date: Tue, 20 Oct 2026 01:07:13 -0400
-Subject: [RFC PATCH 000/112] btrfs: close the raid56 write hole for datacow with stripe-exclusive allocation
+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
To: linux-btrfs@vger.kernel.org
[STALE COVER -- DO NOT SEND AS IS. This letter was written when the
outright, and the property patch moved up to 4 so the policy has its
interface from the start.
-Zygo Blaxell (112):
+Zygo Blaxell (114):
btrfs: add btrfs_claim_free_stripe_run() for stripe-exclusive
allocation
btrfs: add open stripe run tracking for stripe-exclusive allocation
out
btrfs: stripe_alloc: do not miss bitmap free space when debiting a
trim
+ btrfs: log block group reclaim at debug level
+ btrfs: stripe_alloc: add stripe_reclaim_now to reclaim stripes on
+ demand
- fs/btrfs/block-group.c | 3679 ++++++++++++++++++++++++++++-
- fs/btrfs/block-group.h | 306 ++-
+ fs/btrfs/block-group.c | 3855 ++++++++++++++++++++++++++++-
+ fs/btrfs/block-group.h | 313 ++-
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 | 1264 +++++++++-
- fs/btrfs/free-space-cache.h | 12 +
- fs/btrfs/fs.h | 271 +++
+ fs/btrfs/free-space-cache.c | 1291 +++++++++-
+ fs/btrfs/free-space-cache.h | 21 +
+ fs/btrfs/fs.h | 271 ++
fs/btrfs/inode.c | 124 +-
fs/btrfs/messages.c | 3 +
fs/btrfs/ordered-data.c | 84 +
fs/btrfs/ordered-data.h | 14 +
fs/btrfs/props.c | 154 ++
fs/btrfs/props.h | 1 +
- fs/btrfs/raid56.c | 1493 +++++++++++-
+ fs/btrfs/raid56.c | 1493 ++++++++++-
fs/btrfs/raid56.h | 34 +
fs/btrfs/relocation.c | 302 ++-
fs/btrfs/relocation.h | 2 +-
fs/btrfs/space-info.c | 339 ++-
fs/btrfs/space-info.h | 70 +-
fs/btrfs/super.c | 42 +
- fs/btrfs/sysfs.c | 397 ++++
+ fs/btrfs/sysfs.c | 426 ++++
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, 10075 insertions(+), 127 deletions(-)
+ 41 files changed, 10321 insertions(+), 129 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/112] btrfs: add btrfs_claim_free_stripe_run() for
+Subject: [RFC PATCH 001/114] 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/112] btrfs: add open stripe run tracking for
+Subject: [RFC PATCH 002/114] 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/112] btrfs: add the stripe_alloc allocation policy for
+Subject: [RFC PATCH 003/114] 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/112] btrfs: stripe_alloc: control the policy with a
+Subject: [RFC PATCH 004/114] 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/112] btrfs: report stripe run data IO through the
+Subject: [RFC PATCH 005/114] 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/112] btrfs: retire stripe runs at commit and gate
+Subject: [RFC PATCH 006/114] 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/112] btrfs: add a write-hole invariant checker to the
+Subject: [RFC PATCH 007/114] 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/112] btrfs: account stripe_alloc trapped free space
+Subject: [RFC PATCH 008/114] 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/112] btrfs: stripe_alloc: keep an open run per size
+Subject: [RFC PATCH 009/114] 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/112] btrfs: stripe_alloc: grow the frontier run
+Subject: [RFC PATCH 010/114] 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/112] btrfs: raid56: batch stripe_alloc partial writes
+Subject: [RFC PATCH 011/114] 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/112] btrfs: stripe_alloc: never claim stripes covered
+Subject: [RFC PATCH 012/114] 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/112] btrfs: stripe_alloc: settle a logged extent's
+Subject: [RFC PATCH 013/114] 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/112] btrfs: stripe_alloc: private per-inode stripe
+Subject: [RFC PATCH 014/114] 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/112] btrfs: stripe_alloc: carry an inode's log tail
+Subject: [RFC PATCH 015/114] 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/112] btrfs: stripe_alloc: kick parked rbios before the
+Subject: [RFC PATCH 016/114] 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/112] btrfs: raid56: pad sub-stripe writes to full
+Subject: [RFC PATCH 017/114] 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/112] btrfs: stripe_alloc: isolate nodatacow and
+Subject: [RFC PATCH 018/114] 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/112] btrfs: stripe_alloc: allow-rmw policy, and
+Subject: [RFC PATCH 019/114] 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/112] btrfs: stripe_alloc: persist nocow runs across
+Subject: [RFC PATCH 020/114] 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/112] btrfs: raid56: do not park sync writes into nocow
+Subject: [RFC PATCH 021/114] 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/112] btrfs: raid56: expose parking statistics in sysfs
+Subject: [RFC PATCH 022/114] 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/112] btrfs: raid56: skip parking for sync rbios
+Subject: [RFC PATCH 023/114] 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/112] btrfs: stripe_alloc: count open stripe run
+Subject: [RFC PATCH 024/114] 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/112] btrfs: stripe_alloc: pessimistic data reservation
+Subject: [RFC PATCH 025/114] 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/112] btrfs: stripe_alloc: claim fully-free stripes
+Subject: [RFC PATCH 026/114] 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/112] btrfs: stripe_alloc: warn when raid56 metadata is
+Subject: [RFC PATCH 027/114] 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/112] btrfs: stripe_alloc: report read-modify-write of
+Subject: [RFC PATCH 028/114] 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/112] btrfs: raid56: say whether a metadata
+Subject: [RFC PATCH 029/114] 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/112] btrfs: stripe_alloc: tunable park deadlines, and
+Subject: [RFC PATCH 030/114] 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/112] btrfs: stripe_alloc: trace why padding declined,
+Subject: [RFC PATCH 031/114] 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/112] btrfs: stripe_alloc: complete parked writes on
+Subject: [RFC PATCH 032/114] 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/112] btrfs: stripe_alloc: track per-sector liveness
+Subject: [RFC PATCH 033/114] 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/112] btrfs: stripe_alloc: count claimable whole-stripe
+Subject: [RFC PATCH 034/114] 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/112] btrfs: raid56: adaptive park deadline from the
+Subject: [RFC PATCH 035/114] 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/112] btrfs: stripe_alloc: gate data admission on
+Subject: [RFC PATCH 036/114] 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/112] btrfs: stripe_alloc: cache a failed stripe run
+Subject: [RFC PATCH 037/114] 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/112] btrfs: stripe_meta: allocate tree blocks by whole
+Subject: [RFC PATCH 038/114] 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/112] btrfs: stripe_alloc: drain the legacy allocator's
+Subject: [RFC PATCH 039/114] 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/112] btrfs: stripe_alloc: keep the admitted bytes
+Subject: [RFC PATCH 040/114] 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/112] btrfs: stripe_alloc: never let relocation wait on
+Subject: [RFC PATCH 041/114] 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/112] btrfs: stripe_alloc: give a queued stripe group a
+Subject: [RFC PATCH 042/114] 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/112] btrfs: stripe_alloc: charge relocation a margin
+Subject: [RFC PATCH 043/114] 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/112] btrfs: stripe_alloc: keep the relocation group's
+Subject: [RFC PATCH 044/114] 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/112] btrfs: stripe_alloc: let a data write fall back
+Subject: [RFC PATCH 045/114] 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/112] btrfs: stripe_alloc: hand groups full of trapped
+Subject: [RFC PATCH 046/114] 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/112] btrfs: stripe_alloc: relocate a queued stripe
+Subject: [RFC PATCH 047/114] 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/112] btrfs: stripe_meta: maintain trapped free space
+Subject: [RFC PATCH 048/114] 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/112] btrfs: stripe_meta: back the global reserve with
+Subject: [RFC PATCH 049/114] 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/112] btrfs: stripe_meta: hold back whole stripes so
+Subject: [RFC PATCH 050/114] 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/112] btrfs: stripe_meta: do not steal from the global
+Subject: [RFC PATCH 051/114] 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/112] btrfs: stripe_meta: let the transaction
+Subject: [RFC PATCH 052/114] 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/112] btrfs: stripe_meta: let a group go read-only for
+Subject: [RFC PATCH 053/114] 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/112] btrfs: stripe_alloc: show per-group trapped bytes
+Subject: [RFC PATCH 054/114] 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/112] btrfs: stripe_alloc: tell a dead tree block from
+Subject: [RFC PATCH 055/114] 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/112] btrfs: stripe_alloc: do not read an inline
+Subject: [RFC PATCH 056/114] 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/112] btrfs: stripe_alloc: count whole stripes stranded
+Subject: [RFC PATCH 057/114] 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/112] btrfs: stripe_alloc: give nocow extents a private
+Subject: [RFC PATCH 058/114] 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/112] btrfs: stripe_alloc: count nocow run lifecycles
+Subject: [RFC PATCH 059/114] 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/112] btrfs: stripe_alloc: hold a stripe of margin
+Subject: [RFC PATCH 060/114] 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/112] btrfs: stripe_meta: carry raid56 metadata groups
+Subject: [RFC PATCH 061/114] 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/112] btrfs: stripe_alloc: return a group's allocation
+Subject: [RFC PATCH 062/114] 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/112] btrfs: stripe_alloc: release open stripe runs
+Subject: [RFC PATCH 063/114] 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/112] btrfs: stripe_alloc: say at mount whether the
+Subject: [RFC PATCH 064/114] 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/112] btrfs: stripe_meta: cover raid56 system chunks
+Subject: [RFC PATCH 065/114] 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/112] btrfs: stripe_alloc: close dead nocow stripe runs
+Subject: [RFC PATCH 066/114] 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/112] btrfs: stripe_alloc: do not round a full stripe
+Subject: [RFC PATCH 067/114] 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/112] btrfs: stripe_alloc: do not wait for stripe runs
+Subject: [RFC PATCH 068/114] 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/112] btrfs: stripe_alloc: end the commit-time and log
+Subject: [RFC PATCH 069/114] 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/112] btrfs: stripe_alloc: compact mostly live groups
+Subject: [RFC PATCH 070/114] 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/112] btrfs: stripe_alloc: attribute each data
+Subject: [RFC PATCH 071/114] 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/112] btrfs: stripe_alloc: optionally audit data
+Subject: [RFC PATCH 072/114] 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/112] btrfs: stripe_alloc: keep relocation's stripe
+Subject: [RFC PATCH 073/114] 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/112] btrfs: stripe_alloc: let relocation allocate a
+Subject: [RFC PATCH 074/114] 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/112] btrfs: stripe_alloc: keep a stripe in the rbio
+Subject: [RFC PATCH 075/114] 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/112] btrfs: stripe_alloc: pad a stripe's allocated
+Subject: [RFC PATCH 076/114] 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/112] btrfs: stripe_alloc: apply the property before
+Subject: [RFC PATCH 077/114] 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/112] btrfs: stripe_alloc: count refused rbio pins and
+Subject: [RFC PATCH 078/114] 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/112] btrfs: stripe_alloc: sweep stale rbio pins, and
+Subject: [RFC PATCH 079/114] 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/112] btrfs: stripe_alloc: break rbio pins and open
+Subject: [RFC PATCH 080/114] 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/112] btrfs: stripe_alloc: give each log commit its own
+Subject: [RFC PATCH 081/114] 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/112] btrfs: stripe_alloc: don't make a parked rbio
+Subject: [RFC PATCH 082/114] 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/112] btrfs: stripe_alloc: share LOG data runs per log
+Subject: [RFC PATCH 083/114] 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/112] btrfs: stripe_alloc: let relocation allocate as
+Subject: [RFC PATCH 084/114] 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/112] btrfs: stripe_alloc: key private stripe runs by
+Subject: [RFC PATCH 085/114] 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/112] btrfs: stripe_alloc: do not treat an allocation
+Subject: [RFC PATCH 086/114] 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/112] btrfs: stripe_alloc: mark an ended ordered
+Subject: [RFC PATCH 087/114] 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/112] btrfs: stripe_alloc: read the shared LOG run mode
+Subject: [RFC PATCH 088/114] 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/112] btrfs: stripe_alloc: remove only the set bits of
+Subject: [RFC PATCH 089/114] 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/112] btrfs: stripe_alloc: claim a stripe tail in one
+Subject: [RFC PATCH 090/114] 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/112] btrfs: stripe_alloc: keep the stripe totals
+Subject: [RFC PATCH 091/114] 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/112] btrfs: stripe_alloc: do not delete an unused
+Subject: [RFC PATCH 092/114] 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/112] btrfs: stripe_meta: commit before waiting for
+Subject: [RFC PATCH 093/114] 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/112] btrfs: raid56: do not read tree blocks under the
+Subject: [RFC PATCH 094/114] 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/112] btrfs: raid56: stop the park timer before
+Subject: [RFC PATCH 095/114] 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/112] btrfs: stripe_alloc: order the filesystem error
+Subject: [RFC PATCH 096/114] 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/112] btrfs: raid56: set a padded rbio's data bitmap
+Subject: [RFC PATCH 097/114] 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/112] btrfs: stripe_alloc: forget the failed-claim
+Subject: [RFC PATCH 098/114] 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/112] btrfs: stripe_alloc: do not let a remount revert
+Subject: [RFC PATCH 099/114] 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/112] btrfs: stripe_alloc: do not block a NOWAIT write
+Subject: [RFC PATCH 100/114] 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/112] btrfs: stripe_alloc: keep the head of a claimed
+Subject: [RFC PATCH 101/114] 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/112] btrfs: stripe_meta: check the block group lookup
+Subject: [RFC PATCH 102/114] 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/112] btrfs: stripe_alloc: remove the unused
+Subject: [RFC PATCH 103/114] 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/112] btrfs: stripe_alloc: correct and trim the block
+Subject: [RFC PATCH 104/114] 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/112] btrfs: stripe_alloc: correct and trim the
+Subject: [RFC PATCH 105/114] 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/112] btrfs: stripe_meta: keep waiting for metadata
+Subject: [RFC PATCH 106/114] 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/112] btrfs: stripe_alloc: remove pad refusal reasons
+Subject: [RFC PATCH 107/114] 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/112] btrfs: stripe_alloc: count and log ordered
+Subject: [RFC PATCH 108/114] 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/112] btrfs: stripe_alloc: skip RAID5/6 groups that are
+Subject: [RFC PATCH 109/114] 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/112] btrfs: stripe_alloc: count single-data-stripe
+Subject: [RFC PATCH 110/114] 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/112] btrfs: stripe_alloc: account claimable stripes
+Subject: [RFC PATCH 111/114] 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/112] btrfs: stripe_alloc: do not miss bitmap free
+Subject: [RFC PATCH 112/114] btrfs: stripe_alloc: do not miss bitmap free
space when debiting a trim
To: linux-btrfs@vger.kernel.org
--- /dev/null
+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
+To: linux-btrfs@vger.kernel.org
+
+The reclaim worker relocates and compacts block groups without a word in
+the kernel log: btrfs_relocate_chunk() is called with verbose=false, and
+the "reclaiming chunk" info message was removed as log spam in a507904090d0
+("btrfs: remove redundant auto reclaim log message"). Only the
+btrfs_reclaim_block_group tracepoint and the reclaim_count/reclaim_errors
+counters in sysfs remain, so a kernel log taken from a test or a user
+report cannot show which groups reclaim moved, or when. Under stripe_alloc
+this hid automatic relocation and compaction from tests that read the log:
+stripe-reclaim-test counted relocation lines and always saw none, and an
+octopus replace stalled behind a reclaim that left no trace.
+
+Log the start of each reclaim (relocate or compact, with the group's
+flags, length, used, reserved and trapped bytes) and its successful end
+with btrfs_debug(), so they are off by default and can be enabled with
+dynamic debug:
+
+ echo 'file fs/btrfs/block-group.c format "reclaim: " +p' \
+ > /sys/kernel/debug/dynamic_debug/control
+
+Errors are still logged with btrfs_err() as before.
+
+Assisted-by: Claude:claude-opus-5-5
+---
+ fs/btrfs/block-group.c | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
+index 65340f18ae7a4..dde544f6b3bdd 100644
+--- a/fs/btrfs/block-group.c
++++ b/fs/btrfs/block-group.c
+@@ -5400,8 +5400,10 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
+ u64 used;
+ u64 reserved;
+ u64 old_total;
++ u64 trapped;
+ int ret = 0;
+ bool compact = false;
++ bool compacted = false;
+
+ /*
+ * A stripe_alloc / stripe_meta group's live extents can only move into
+@@ -5548,12 +5550,17 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
+ spin_lock(&bg->lock);
+ used = bg->used;
+ reserved = bg->reserved;
++ /* Trapped as the reclaim trigger counts it. */
++ trapped = bg->stripe_unusable -
++ min(bg->stripe_unusable, bg->stripe_stranded);
+ spin_unlock(&bg->lock);
+
+ trace_btrfs_reclaim_block_group(bg);
++ btrfs_debug(fs_info,
++"reclaim: %s block group %llu flags 0x%llx length %llu used %llu reserved %llu trapped %llu",
++ compact ? "compacting" : "relocating", bg->start, bg->flags,
++ bg->length, used, reserved, trapped);
+ if (compact) {
+- bool compacted;
+-
+ ret = btrfs_compact_chunk(fs_info, bg->start, &compacted);
+ /*
+ * Compacted, the group stays: drop our read-only hold. It
+@@ -5590,8 +5597,11 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
+ if (space_info->total_bytes < old_total)
+ btrfs_set_periodic_reclaim_ready(space_info, true);
+ spin_unlock(&space_info->lock);
+- if (!ret)
++ if (!ret) {
+ (*reclaimed)++;
++ btrfs_debug(fs_info, "reclaim: %s block group %llu",
++ compacted ? "compacted" : "relocated", bg->start);
++ }
+
+ return ret;
+ }
+--
+2.47.3
+
--- /dev/null
+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
+ reclaim stripes on demand
+To: linux-btrfs@vger.kernel.org
+
+Background reclaim of stripe_alloc / stripe_meta raid56 groups runs when a
+commit-time rescan, or the cleaner's tick at most every five minutes per
+group, finds a group past bg_reclaim_threshold. Nothing lets an operator
+say "reclaim now": during an idle period, before a large write, or for one
+group seen trapped. The only tool is balance, which relocates whole groups
+whatever their state and cannot compact.
+
+Add /sys/fs/btrfs/<uuid>/stripe_reclaim_now (write-only, root):
+
+ echo all > stripe_reclaim_now (or "1")
+ Queue every stripe_alloc / stripe_meta raid56 group that the
+ reclaim predicate picks: relocate below the threshold once enough
+ of its free space is trapped, compact above it once stripe_compact
+ percent of its length is trapped. The five-minute hysteresis is
+ ignored.
+
+ echo <start> > stripe_reclaim_now
+ Reclaim the group at that logical start (decimal or 0x hex, as
+ `btrfs inspect-internal dump-tree -t chunk` and the "reclaim: "
+ debug lines print it) whatever its trapped space:
+ compact it if it is above the threshold and has trapped stripes,
+ relocate it otherwise.
+
+The threshold is the space_info's bg_reclaim_threshold, or 75
+(BTRFS_DEFAULT_RECLAIM_THRESH) where that is 0, the non-zoned default,
+since the request is explicit. Both forms keep the room check: the other
+groups' claimable stripes, plus the one chunk the worker allocates when
+those fall short, must take what moves. The write returns once the groups
+are queued; it does not wait for the reclaim. The worker re-checks its
+thresholds and would drop a group it was asked to reclaim, so a group
+queued by this knob carries the kind of reclaim to do
+(stripe_reclaim_forced), which the worker honours once and clears.
+
+Errors: -ENOENT when no group starts there; -EINVAL for anything but a
+stripe_alloc / stripe_meta raid56 group (balance's vrange filter relocates
+the others); -EBUSY when the group is read-only (a balance or scrub has
+it); -EAGAIN when it is already on a list (queued, unused or new);
+-ENOSPC when there is no room; -EROFS on a read-only or errored
+filesystem. The worker takes the balance exclusive operation and gives the
+list back when another holds it, so a request made while a balance,
+replace, resize or device add/remove runs would wait unseen: it fails at
+once with -EAGAIN and nothing is queued; retry when the operation is done.
+The reclaim worker's own hold (a balance with no balance control) is not
+refused, as the worker picks up the new entries.
+
+Expected use: an idle-time job (cron) writes "all"; an operator writes the
+start of one group taken from the "reclaim: " debug lines or from the
+chunk tree. The queued groups are logged at debug level with the same
+"reclaim: " prefix.
+
+There is no in-tree btrfs sysfs documentation; the btrfs-progs sysfs
+chapter should list the file.
+
+Tested with stripe-reclaim-now-test.sh (raid56-wh-harness): with
+background reclaim off nothing moves; one group is relocated alone, and a
+group above the threshold with trapped stripes is compacted; "all"
+reclaims and trapped space falls; no such group, not a number, a raid1
+metadata group and a read-only mount fail with the codes above, and a
+paused balance and a running replace fail with -EAGAIN; data verifies and
+btrfs check is clean.
+
+Assisted-by: Claude:claude-opus-5-5
+---
+ fs/btrfs/block-group.c | 166 +++++++++++++++++++++++++++++++++++-
+ fs/btrfs/block-group.h | 7 ++
+ fs/btrfs/free-space-cache.c | 53 +++++++++---
+ fs/btrfs/free-space-cache.h | 9 ++
+ fs/btrfs/sysfs.c | 29 +++++++
+ 5 files changed, 249 insertions(+), 15 deletions(-)
+
+diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
+index dde544f6b3bdd..da9c005069b59 100644
+--- a/fs/btrfs/block-group.c
++++ b/fs/btrfs/block-group.c
+@@ -5402,6 +5402,7 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
+ u64 old_total;
+ u64 trapped;
+ int ret = 0;
++ u8 forced = READ_ONCE(bg->stripe_reclaim_forced);
+ bool compact = false;
+ bool compacted = false;
+
+@@ -5418,7 +5419,8 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
+ u64 need = READ_ONCE(bg->used);
+
+ /* Compaction moves at most half of it. */
+- if (btrfs_stripe_bg_wants_compaction(bg))
++ if (forced ? forced == STRIPE_RECLAIM_COMPACT :
++ btrfs_stripe_bg_wants_compaction(bg))
+ need /= 2;
+ elsewhere -= min(elsewhere, READ_ONCE(bg->stripe_claimable));
+ if (elsewhere < need) {
+@@ -5440,6 +5442,9 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
+
+ spin_lock(&space_info->lock);
+ spin_lock(&bg->lock);
++ /* A forced reclaim is done once, or dropped with the group. */
++ forced = bg->stripe_reclaim_forced;
++ bg->stripe_reclaim_forced = STRIPE_RECLAIM_NONE;
+ if (bg->ro ||
+ ((bg->reserved || bg->pinned) &&
+ !btrfs_is_stripe_alloc_bg(bg) &&
+@@ -5492,7 +5497,10 @@ static int btrfs_reclaim_block_group(struct btrfs_block_group *bg, int *reclaime
+ * check, which is more meaningful when adding to the list in
+ * the first place.
+ */
+- if (!should_reclaim_block_group(bg, bg->length)) {
++ if (forced) {
++ /* stripe_reclaim_now chose already; the thresholds may say no. */
++ compact = (forced == STRIPE_RECLAIM_COMPACT);
++ } else if (!should_reclaim_block_group(bg, bg->length)) {
+ /*
+ * Too full to relocate whole. A stripe_alloc / stripe_meta
+ * group whose free space is trapped in partially used stripes
+@@ -5765,6 +5773,160 @@ bool btrfs_mark_bg_to_reclaim(struct btrfs_block_group *bg)
+ return true;
+ }
+
++/*
++ * Room for a forced reclaim beyond the other groups' claimable stripes: the
++ * one chunk the reclaim worker allocates when they fall short (see
++ * btrfs_reclaim_block_group()), estimated as the data share of the
++ * unallocated device space at @bg's width, capped at @bg's length.
++ */
++static u64 stripe_reclaim_chunk_room(struct btrfs_block_group *bg)
++{
++ struct btrfs_fs_info *fs_info = bg->fs_info;
++ struct btrfs_chunk_map *map;
++ u64 unalloc = atomic64_read(&fs_info->free_chunk_space);
++ u64 room;
++
++ map = btrfs_get_chunk_map(fs_info, bg->start, 1);
++ if (IS_ERR(map))
++ return 0;
++ room = div_u64(unalloc * nr_data_stripes(map), map->num_stripes);
++ btrfs_free_chunk_map(map);
++ return min(room, bg->length);
++}
++
++/*
++ * Queue @bg for the reclaim worker with the reclaim it is to do. Returns
++ * false when the group is already on a list (queued, unused or new).
++ */
++static bool stripe_reclaim_now_queue(struct btrfs_block_group *bg,
++ enum stripe_reclaim_kind kind)
++{
++ bool queued;
++
++ spin_lock(&bg->lock);
++ bg->stripe_reclaim_forced = kind;
++ queued = btrfs_mark_bg_to_reclaim(bg);
++ if (queued)
++ bg->stripe_reclaim_jiffies = jiffies ?: 1;
++ else
++ bg->stripe_reclaim_forced = STRIPE_RECLAIM_NONE;
++ spin_unlock(&bg->lock);
++ if (queued)
++ btrfs_debug(bg->fs_info,
++ "reclaim: queued block group %llu to %s (stripe_reclaim_now)",
++ bg->start, kind == STRIPE_RECLAIM_COMPACT ?
++ "compact" : "relocate");
++ return queued;
++}
++
++/*
++ * /sys/fs/btrfs/<uuid>/stripe_reclaim_now: reclaim stripe_alloc / stripe_meta
++ * raid56 block groups now, e.g. from an idle-time job, rather than waiting
++ * for the commit-time rescan and its five-minute hysteresis. The threshold
++ * is the space_info's bg_reclaim_threshold, or BTRFS_DEFAULT_RECLAIM_THRESH
++ * where that is 0 (reclaim off), since the request is explicit.
++ *
++ * @all: queue every such group the reclaim predicate picks at that
++ * threshold (relocate below it, compact above it once stripe_compact percent
++ * is trapped), ignoring the hysteresis.
++ *
++ * Otherwise @start names one group (its logical start): it is reclaimed
++ * whatever the trapped minimums say, compacted if it is above the threshold
++ * and has trapped stripes, relocated otherwise. -ENOENT: no group starts
++ * there; -EINVAL: not a stripe_alloc / stripe_meta raid56 group (relocate
++ * any other group with balance's vrange filter); -EBUSY: the group is
++ * read-only (balance or scrub hold it); -EAGAIN: it is already on a list
++ * (queued, unused or new); -ENOSPC: the other groups' claimable stripes plus
++ * one new chunk cannot take what would move.
++ *
++ * Both return once the groups are queued, without waiting for the reclaim.
++ * The worker takes the balance exclusive operation and gives the list back
++ * when another operation holds it, so a request made while a balance,
++ * replace, resize or device add/remove runs fails at once with -EAGAIN
++ * rather than wait unseen; nothing is queued. The reclaim worker's own hold
++ * (a balance with no balance control) is not refused: it picks up the new
++ * entries.
++ */
++int btrfs_stripe_reclaim_now(struct btrfs_fs_info *fs_info, bool all, u64 start)
++{
++ struct btrfs_space_info *sinfo;
++ struct btrfs_block_group *bg;
++ enum btrfs_exclusive_operation op;
++ enum stripe_reclaim_kind kind;
++ int queued = 0;
++ int ret = 0;
++
++ if (sb_rdonly(fs_info->sb) || BTRFS_FS_ERROR(fs_info))
++ return -EROFS;
++ spin_lock(&fs_info->super_lock);
++ op = fs_info->exclusive_operation;
++ spin_unlock(&fs_info->super_lock);
++ if (op != BTRFS_EXCLOP_NONE &&
++ (op != BTRFS_EXCLOP_BALANCE || READ_ONCE(fs_info->balance_ctl)))
++ return -EAGAIN;
++
++ if (!all) {
++ bg = btrfs_lookup_block_group(fs_info, start);
++ if (!bg)
++ return -ENOENT;
++ if (bg->start != start) {
++ ret = -ENOENT;
++ } else if (!btrfs_is_stripe_alloc_bg(bg) &&
++ !btrfs_is_stripe_meta_bg(bg)) {
++ ret = -EINVAL;
++ } else if (READ_ONCE(bg->ro)) {
++ ret = -EBUSY;
++ } else {
++ int thresh = READ_ONCE(bg->space_info->bg_reclaim_threshold);
++
++ kind = btrfs_stripe_bg_reclaim_now_kind(bg,
++ thresh > 0 ? thresh : BTRFS_DEFAULT_RECLAIM_THRESH,
++ true, stripe_reclaim_chunk_room(bg));
++ if (kind == STRIPE_RECLAIM_NONE)
++ ret = READ_ONCE(bg->ro) ? -EBUSY : -ENOSPC;
++ else if (stripe_reclaim_now_queue(bg, kind))
++ queued = 1;
++ else
++ ret = -EAGAIN;
++ }
++ btrfs_put_block_group(bg);
++ if (ret)
++ return ret;
++ goto kick;
++ }
++
++ list_for_each_entry(sinfo, &fs_info->space_info, list) {
++ int thresh = READ_ONCE(sinfo->bg_reclaim_threshold);
++ int raid;
++
++ if (thresh <= 0)
++ thresh = BTRFS_DEFAULT_RECLAIM_THRESH;
++ down_read(&sinfo->groups_sem);
++ for (raid = 0; raid < BTRFS_NR_RAID_TYPES; raid++) {
++ if (!(btrfs_raid_array[raid].bg_flag &
++ BTRFS_BLOCK_GROUP_RAID56_MASK))
++ continue;
++ list_for_each_entry(bg, &sinfo->block_groups[raid], list) {
++ if (!btrfs_is_stripe_alloc_bg(bg) &&
++ !btrfs_is_stripe_meta_bg(bg))
++ continue;
++ kind = btrfs_stripe_bg_reclaim_now_kind(bg, thresh,
++ false, stripe_reclaim_chunk_room(bg));
++ if (kind != STRIPE_RECLAIM_NONE &&
++ stripe_reclaim_now_queue(bg, kind))
++ queued++;
++ }
++ }
++ up_read(&sinfo->groups_sem);
++ }
++ btrfs_debug(fs_info, "reclaim: stripe_reclaim_now queued %d block groups",
++ queued);
++kick:
++ if (queued)
++ queue_work(system_dfl_wq, &fs_info->reclaim_bgs_work);
++ return 0;
++}
++
+ static int read_bg_from_eb(struct btrfs_fs_info *fs_info, const struct btrfs_key *key,
+ const struct btrfs_path *path)
+ {
+diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
+index 202d9f73678de..bc26b9e875506 100644
+--- a/fs/btrfs/block-group.h
++++ b/fs/btrfs/block-group.h
+@@ -332,6 +332,12 @@ struct btrfs_block_group {
+ u64 stripe_stranded;
+ /* jiffies when the reclaim trigger last queued this group (stripe_alloc) */
+ unsigned long stripe_reclaim_jiffies;
++ /*
++ * Reclaim forced by stripe_reclaim_now (enum stripe_reclaim_kind):
++ * the reclaim worker does this instead of re-checking its thresholds,
++ * once, and clears it. Protected by ->lock.
++ */
++ u8 stripe_reclaim_forced;
+ /*
+ * Directly measured claimable supply: bytes of fully free, aligned
+ * whole stripes in the free space cache -- exactly what
+@@ -649,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);
++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,
+ struct btrfs_space_info *space_info,
+diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
+index 8303110638dcf..f3a8381e05de5 100644
+--- a/fs/btrfs/free-space-cache.c
++++ b/fs/btrfs/free-space-cache.c
+@@ -2413,19 +2413,15 @@ 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.
+ */
+-enum stripe_reclaim_kind {
+- STRIPE_RECLAIM_NONE,
+- STRIPE_RECLAIM_RELOCATE,
+- STRIPE_RECLAIM_COMPACT,
+-};
+-
+-static enum stripe_reclaim_kind stripe_bg_reclaim_kind(struct btrfs_block_group *bg,
+- bool check_room)
++static enum stripe_reclaim_kind __stripe_bg_reclaim_kind(struct btrfs_block_group *bg,
++ int thresh, bool force,
++ bool check_room,
++ u64 extra_room)
+ {
+ struct btrfs_space_info *sinfo = bg->space_info;
+- const int thresh = READ_ONCE(sinfo->bg_reclaim_threshold);
++ const bool ready = READ_ONCE(bg->stripe_unusable_ready);
+ const u64 used = READ_ONCE(bg->used);
+- const u64 unusable = READ_ONCE(bg->stripe_unusable);
++ const u64 unusable = ready ? READ_ONCE(bg->stripe_unusable) : 0;
+ /*
+ * Stripes stranded behind live runs are trapped for admission but not
+ * for reclaim: they come back by themselves when the run is freed, and
+@@ -2437,9 +2433,19 @@ static enum stripe_reclaim_kind stripe_bg_reclaim_kind(struct btrfs_block_group
+ u64 elsewhere;
+ u64 promised;
+
+- if (thresh <= 0 || bg->ro || !READ_ONCE(bg->stripe_unusable_ready))
++ if (thresh <= 0 || bg->ro || (!ready && !force))
+ return STRIPE_RECLAIM_NONE;
+- if (used >= mult_perc(bg->length, thresh)) {
++ if (force) {
++ /*
++ * Forced (stripe_reclaim_now naming this group): no trapped
++ * minimum. Compact a group too full to move whole if it has
++ * any trapped stripe, otherwise relocate it.
++ */
++ if (used >= mult_perc(bg->length, thresh) && trapped) {
++ kind = STRIPE_RECLAIM_COMPACT;
++ need = used / 2;
++ }
++ } else if (used >= mult_perc(bg->length, thresh)) {
+ /*
+ * Too full to move whole: compact once trapped space reaches
+ * stripe_compact percent of the group's length. (A share of
+@@ -2463,7 +2469,15 @@ static enum stripe_reclaim_kind stripe_bg_reclaim_kind(struct btrfs_block_group
+ READ_ONCE(sinfo->bytes_stripe_margin);
+ elsewhere -= min(elsewhere, READ_ONCE(bg->stripe_claimable));
+ elsewhere -= min(elsewhere, promised);
+- return elsewhere >= need ? kind : STRIPE_RECLAIM_NONE;
++ return elsewhere + extra_room >= need ? kind : STRIPE_RECLAIM_NONE;
++}
++
++static enum stripe_reclaim_kind stripe_bg_reclaim_kind(struct btrfs_block_group *bg,
++ bool check_room)
++{
++ return __stripe_bg_reclaim_kind(bg,
++ READ_ONCE(bg->space_info->bg_reclaim_threshold),
++ false, check_room, 0);
+ }
+
+ bool btrfs_stripe_bg_wants_reclaim(struct btrfs_block_group *bg)
+@@ -2471,6 +2485,19 @@ bool btrfs_stripe_bg_wants_reclaim(struct btrfs_block_group *bg)
+ return stripe_bg_reclaim_kind(bg, true) != STRIPE_RECLAIM_NONE;
+ }
+
++/*
++ * For stripe_reclaim_now: the reclaim @bg gets at threshold @thresh, room
++ * checked with @extra_room bytes (the chunk the worker may allocate) added to
++ * the other groups' claimable supply. @force drops the trapped minimums: see
++ * btrfs_stripe_reclaim_now().
++ */
++enum stripe_reclaim_kind btrfs_stripe_bg_reclaim_now_kind(struct btrfs_block_group *bg,
++ int thresh, bool force,
++ u64 extra_room)
++{
++ return __stripe_bg_reclaim_kind(bg, thresh, force, true, extra_room);
++}
++
+ /*
+ * For the reclaim worker, about a group it took: compact it rather than
+ * relocate it whole. Room is not re-checked; the worker makes room first,
+diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h
+index ceb933d51a169..94d60f9efece3 100644
+--- a/fs/btrfs/free-space-cache.h
++++ b/fs/btrfs/free-space-cache.h
+@@ -119,8 +119,17 @@ void btrfs_block_group_init_stripe_unusable(struct btrfs_block_group *block_grou
+ void btrfs_block_group_disarm_stripe_unusable(struct btrfs_block_group *block_group);
+ void btrfs_stripe_unmanaged_sync(struct btrfs_block_group *block_group);
+ void btrfs_block_group_rescan_stripe_unusable(struct btrfs_block_group *block_group);
++enum stripe_reclaim_kind {
++ STRIPE_RECLAIM_NONE,
++ STRIPE_RECLAIM_RELOCATE,
++ STRIPE_RECLAIM_COMPACT,
++};
++
+ bool btrfs_stripe_bg_wants_reclaim(struct btrfs_block_group *bg);
+ bool btrfs_stripe_bg_wants_compaction(struct btrfs_block_group *bg);
++enum stripe_reclaim_kind btrfs_stripe_bg_reclaim_now_kind(struct btrfs_block_group *bg,
++ int thresh, bool force,
++ u64 extra_room);
+ s64 btrfs_stripe_partial_map(struct btrfs_block_group *bg, unsigned long *map,
+ u64 nstripes);
+ void btrfs_dump_free_space(struct btrfs_block_group *block_group,
+diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
+index 9928527c7394c..32d751fe87161 100644
+--- a/fs/btrfs/sysfs.c
++++ b/fs/btrfs/sysfs.c
+@@ -1464,6 +1464,34 @@ static ssize_t btrfs_stripe_compact_store(struct kobject *kobj,
+ BTRFS_ATTR_RW(, stripe_compact, btrfs_stripe_compact_show,
+ btrfs_stripe_compact_store);
+
++/*
++ * Reclaim stripe_alloc / stripe_meta raid56 block groups now: "all" (or "1")
++ * queues every group the reclaim predicate picks, a block group's logical
++ * start forces that group. See btrfs_stripe_reclaim_now().
++ */
++static ssize_t btrfs_stripe_reclaim_now_store(struct kobject *kobj,
++ struct kobj_attribute *a,
++ const char *buf, size_t len)
++{
++ struct btrfs_fs_info *fs_info = to_fs_info(kobj);
++ u64 start = 0;
++ bool all;
++ int ret;
++
++ if (!capable(CAP_SYS_ADMIN))
++ return -EPERM;
++
++ all = sysfs_streq(buf, "all") || sysfs_streq(buf, "1");
++ if (!all) {
++ ret = kstrtou64(buf, 0, &start);
++ if (ret)
++ return ret;
++ }
++ ret = btrfs_stripe_reclaim_now(fs_info, all, start);
++ return ret ? ret : len;
++}
++BTRFS_ATTR_W(, stripe_reclaim_now, btrfs_stripe_reclaim_now_store);
++
+
+
+ static ssize_t btrfs_clone_alignment_show(struct kobject *kobj,
+@@ -1840,6 +1868,7 @@ static const struct attribute *btrfs_attrs[] = {
+ BTRFS_ATTR_PTR(, stripe_park_sync_timeout_ms),
+ BTRFS_ATTR_PTR(, stripe_park_congestion),
+ BTRFS_ATTR_PTR(, stripe_compact),
++ BTRFS_ATTR_PTR(, stripe_reclaim_now),
+ BTRFS_ATTR_PTR(, temp_fsid),
+ NULL,
+ };
+--
+2.47.3
+