xfs: prepare repair for bulk loading [v28.3]

Before we start merging the online repair functions, let's improve the
 bulk loading code a bit.  First, we need to fix a misinteraction between
 the AIL and the btree bulkloader wherein the delwri at the end of the
 bulk load fails to queue a buffer for writeback if it happens to be on
 the AIL list.
 
 Second, we introduce a defer ops barrier object so that the process of
 reaping blocks after a repair cannot queue more than two extents per EFI
 log item.  This increases our exposure to leaking blocks if the system
 goes down during a reap, but also should prevent transaction overflows,
 which result in the system going down.
 
 Third, we change the bulkloader itself to copy multiple records into a
 block if possible, and add some debugging knobs so that developers can
 control the slack factors, just like they can do for xfs_repair.
 
 This has been running on the djcloud for months with no problems.  Enjoy!
 
 Signed-off-by: Darrick J. Wong <djwong@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQQ2qTKExjcn+O1o2YRKO3ySh0YRpgUCZXzKAwAKCRBKO3ySh0YR
 pkcvAP0SEt4VLGrWQJqlWZ5e4sWnqDqVPyT/CQMvG86Qm9VcYwEAzbE0/DaA7uN0
 DnceMdho49kTo6FC7+z/lQyGKbl89As=
 =8FAT
 -----END PGP SIGNATURE-----

Merge tag 'repair-prep-for-bulk-loading-6.8_2023-12-15' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.8-mergeB

xfs: prepare repair for bulk loading

Before we start merging the online repair functions, let's improve the
bulk loading code a bit.  First, we need to fix a misinteraction between
the AIL and the btree bulkloader wherein the delwri at the end of the
bulk load fails to queue a buffer for writeback if it happens to be on
the AIL list.

Second, we introduce a defer ops barrier object so that the process of
reaping blocks after a repair cannot queue more than two extents per EFI
log item.  This increases our exposure to leaking blocks if the system
goes down during a reap, but also should prevent transaction overflows,
which result in the system going down.

Third, we change the bulkloader itself to copy multiple records into a
block if possible, and add some debugging knobs so that developers can
control the slack factors, just like they can do for xfs_repair.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>

* tag 'repair-prep-for-bulk-loading-6.8_2023-12-15' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
  xfs: constrain dirty buffers while formatting a staged btree
  xfs: move btree bulkload record initialization to ->get_record implementations
  xfs: add debug knobs to control btree bulk load slack factors
  xfs: read leaf blocks when computing keys for bulkloading into node blocks
  xfs: set XBF_DONE on newly formatted btree block that are ready for writing
  xfs: force all buffers to be written during btree bulk load
This commit is contained in:
Chandan Babu R 2023-12-16 08:27:42 +05:30
commit 5e60ca3fad
10 changed files with 198 additions and 35 deletions