• Darrick J. Wong's avatar
    xfs: cache a bunch of inodes for repair scans · a7a686cb
    Darrick J. Wong authored
    After observing xfs_scrub taking forever to rebuild parent pointers on a
    pptrs enabled filesystem, I decided to profile what the system was
    doing.  It turns out that when there are a lot of threads trying to scan
    the filesystem, most of our time is spent contending on AGI buffer
    locks.  Given that we're walking the inobt records anyway, we can often
    tell ahead of time when there's a bunch of (up to 64) consecutive inodes
    that we could grab all at once.
    
    Do this to amortize the cost of taking the AGI lock across as many
    inodes as we possibly can.  On the author's system this seems to improve
    parallel throughput from barely one and a half cores to slightly
    sublinear scaling.  The obvious antipattern here of course is where the
    freemask has every other bit set (e.g. all 0xA's)
    Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    a7a686cb
iscan.c 17.2 KB