xfs: stagger the starting AG of scrub iscans to reduce contention
authorDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:30:46 +0000 (12:30 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 20:30:46 +0000 (12:30 -0800)
commitc473a3320be32b2273042bfdf0fe8db5da7ae5d0
treeb54e7ff49047e3948050c56b21ac1edca1fa098b
parent4e98cc905c0fec337416e9fd7ca4f75607a6de99
xfs: stagger the starting AG of scrub iscans to reduce contention

Online directory and parent repairs on parent-pointer equipped
filesystems have shown that starting a large number of parallel iscans
causes a lot of AGI buffer contention.  Try to reduce this by making it
so that iscans scan wrap around the end of the filesystem, and using a
rotor to stagger where each scanner begins.  Surprisingly, this boosts
CPU utilization (on the author's test machines) from effectively
single-threaded to 160%.  Not great, but see the next patch.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/iscan.c
fs/xfs/scrub/iscan.h
fs/xfs/scrub/trace.h