diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-08-02 20:06:31 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-11-09 19:07:14 -0800 |
commit | ba882f9137ebc598aec148ba87aed715086d7b44 (patch) | |
tree | abb2c7ff7f849356613f5b83d2ad6867ec084617 /fs/xfs/scrub/scrub.h | |
parent | 3d903b1f72828e7070903a93d7a178c7a2adb450 (diff) |
xfs: scrub should use ECHRNG to signal that the drain is neededscrub-drain-intents_2022-11-09
In the previous patch, we added jump labels to the intent drain code so
that regular filesystem operations need not pay the price of checking
for someone (scrub) waiting on intents to drain from some part of the
filesystem when that someone isn't running.
However, I observed that xfs/285 now spends a lot more time pushing the
AIL from the inode btree scrubber than it used to. This is because the
inobt scrubber will try push the AIL to try to get logged inode cores
written to the filesystem when it sees a weird discrepancy between the
ondisk inode and the inobt records. This AIL push is triggered when the
setup function sees TRY_HARDER is set; and the requisite EDEADLOCK
return is initiated when the discrepancy is seen.
The solution to this performance slow down is to use a different result
code (ECHRNG) for scrub code to signal that it needs to wait for
deferred intent work items to drain out of some part of the filesystem.
When this happens, set a new scrub state flag (XCHK_NEED_DRAIN) so that
setup functions will activate the jump label.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/scrub.h')
-rw-r--r-- | fs/xfs/scrub/scrub.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h index 4ff4b19bee3d..85c055c2ddc5 100644 --- a/fs/xfs/scrub/scrub.h +++ b/fs/xfs/scrub/scrub.h @@ -98,6 +98,7 @@ struct xfs_scrub { #define XCHK_TRY_HARDER (1 << 0) /* can't get resources, try again */ #define XCHK_REAPING_DISABLED (1 << 1) /* background block reaping paused */ #define XCHK_FSHOOKS_DRAIN (1 << 2) /* defer ops draining enabled */ +#define XCHK_NEED_DRAIN (1 << 3) /* scrub needs to use intent drain */ #define XREP_ALREADY_FIXED (1 << 31) /* checking our repair work */ #define XCHK_FSHOOKS_ALL (XCHK_FSHOOKS_DRAIN) |