summaryrefslogtreecommitdiff
path: root/fs/xfs/Makefile
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-12-07 05:40:59 +0300
committerDarrick J. Wong <djwong@kernel.org>2023-12-07 05:45:18 +0300
commitbe408417630427984a1fddd069f30b245793234c (patch)
tree0c7a6b791f70b34ae54dd916cc580445d02bedc6 /fs/xfs/Makefile
parent4c8ecd1cfdd01fb727121035014d9f654a30bdf2 (diff)
downloadlinux-be408417630427984a1fddd069f30b245793234c.tar.xz
xfs: implement block reservation accounting for btrees we're staging
Create a new xrep_newbt structure to encapsulate a fake root for creating a staged btree cursor as well as to track all the blocks that we need to reserve in order to build that btree. As for the particular choice of lowspace thresholds and btree block slack factors -- at this point one could say that the thresholds in online repair come from bulkload_estimate_ag_slack in xfs_repair[1]. But that's not the entire story, since the offline btree rebuilding code in xfs_repair was merged as a retroport of the online btree code in this patchset! Before xfs_btree_staging.[ch] came along, xfs_repair determined the slack factor (aka the number of slots to leave unfilled in each new btree block) via open-coded logic in repair/phase5.c[2]. At that point the slack factors were arbitrary quantities per btree. The rmapbt automatically left 10 slots free; everything else left zero. That had a noticeable effect on performance straight after mounting because adding records to /any/ btree would result in splits. A few years ago when this patch was first written, Dave and I decided that repair should generate btree blocks that were 75% full unless space was tight, in which case it should try to fill the blocks to nearly full. We defined tight as ~10% free to avoid repair failures but settled on 3/32 (~9%) to avoid div64. IOWs, we mostly pulled the thresholds out of thin air. We've been QAing with those geometry numbers ever since. ;) Link: https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/repair/bulkload.c?h=v6.5.0#n114 Link: https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/repair/phase5.c?h=v4.19.0#n1349 Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/Makefile')
-rw-r--r--fs/xfs/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 7762c01a85cf..1537d66e5ab0 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -181,6 +181,7 @@ xfs-$(CONFIG_XFS_QUOTA) += scrub/quota.o
ifeq ($(CONFIG_XFS_ONLINE_REPAIR),y)
xfs-y += $(addprefix scrub/, \
agheader_repair.o \
+ newbt.o \
reap.o \
repair.o \
)