]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_repair: reduce rmap bag memory usage when creating refcounts
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 17:01:18 +0000 (10:01 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:42 +0000 (11:37 -0700)
commit52eb64bd2d6ab6e4a6aff26533566681fdf0083b
treefe075b33121f9b498e9cc1eabfe50f579b71097c
parent2c8006e00ac46542ccfe0c65a741a193622d12cf
xfs_repair: reduce rmap bag memory usage when creating refcounts

The algorithm that computes reference count records uses a "bag"
structure to remember the rmap records corresponding to the current
block.  In the previous patch we converted the bag structure to store
actual rmap records instead of pointers to rmap records owned by another
structure as part of preparing for converting this algorithm to use
in-memory rmap btrees.

However, the memory usage of the bag structure is now excessive -- we
only need the physical extent and inode owner information to generate
refcount records and mark inodes that require the reflink flag.  IOWs,
the flags and offset fields are unnecessary.  Create a custom structure
for the bag, which halves its memory usage.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/rmap.c