]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: read leaf blocks when computing keys for bulkloading into node blocks
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 23:07:37 +0000 (16:07 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 17 Apr 2024 21:06:25 +0000 (14:06 -0700)
commit630045438cd3918f7f563ab9390241df38b6727d
treee64bc72e1a7b2518eae42f9618dcf7974ff4b78d
parent6feab85fb71283e10c46b0961551df9282b5082b
xfs: read leaf blocks when computing keys for bulkloading into node blocks

Source kernel commit: 26de64629d8b439a03bce243f14a46f7440729f3

When constructing a new btree, xfs_btree_bload_node needs to read the
btree blocks for level N to compute the keyptrs for the blocks that will
be loaded into level N+1.  The level N blocks must be formatted at that
point.

A subsequent patch will change the btree bulkloader to write new btree
blocks in 256K chunks to moderate memory consumption if the new btree is
very large.  As a consequence of that, it's possible that the buffers
for lower level blocks might have been reclaimed by the time the node
builder comes back to the block.

Therefore, change xfs_btree_bload_node to read the lower level blocks
to handle the reclaimed buffer case.  As a side effect, the read will
increase the LRU refs, which will bias towards keeping new btree buffers
in memory after the new btree commits.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
libxfs/xfs_btree.c
libxfs/xfs_btree.h
libxfs/xfs_btree_staging.c