diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-04-22 19:48:23 +0300 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-04-24 02:55:17 +0300 |
commit | 271557de7cbfdecb08e89ae1ca74647ceb57224f (patch) | |
tree | 75935093e4f7e4a38a34523211bda8d95b7555ff /fs/jfs/jfs_metapage.h | |
parent | 3f31406aef493b3f19020909d29974e28253f91c (diff) | |
download | linux-271557de7cbfdecb08e89ae1ca74647ceb57224f.tar.xz |
xfs: reduce the rate of cond_resched calls inside scrub
We really don't want to call cond_resched every single time we go
through a loop in scrub -- there may be billions of records, and probing
into the scheduler itself has overhead. Reduce this overhead by only
calling cond_resched 10x per second; and add a counter so that we only
check jiffies once every 1000 records or so.
Surprisingly, this reduces scrub-only fstests runtime by about 2%. I
used the bmapinflate xfs_db command to produce a billion-extent file and
this stupid gadget reduced the scrub runtime by about 4%.
From a stupid microbenchmark of calling these things 1 billion times, I
estimate that cond_resched costs about 5.5ns per call; jiffes costs
about 0.3ns per read; and fatal_signal_pending costs about 0.4ns per
call.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/jfs/jfs_metapage.h')
0 files changed, 0 insertions, 0 deletions