Message ID | 20250303112301.766938-1-alexjlzheng@tencent.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | xfs: don't allow log recover IO to be throttled | expand |
On Mon, Mar 03, 2025 at 07:23:01PM +0800, Jinliang Zheng wrote: > When recovering a large filesystem, avoid log recover IO being > throttled by rq_qos_throttle(). Why? Do you have numbers or a bug report? > diff --git a/fs/xfs/xfs_bio_io.c b/fs/xfs/xfs_bio_io.c > index fe21c76f75b8..259955f2aeb2 100644 > --- a/fs/xfs/xfs_bio_io.c > +++ b/fs/xfs/xfs_bio_io.c > @@ -22,12 +22,15 @@ xfs_rw_bdev( > unsigned int left = count; > int error; > struct bio *bio; > + blk_opf_t opf = op | REQ_META | REQ_SYNC; > > if (is_vmalloc && op == REQ_OP_WRITE) > flush_kernel_vmap_range(data, count); > > - bio = bio_alloc(bdev, bio_max_vecs(left), op | REQ_META | REQ_SYNC, > - GFP_KERNEL); > + if (op == REQ_OP_WRITE) > + opf |= REQ_IDLE; And there's really no need to do any games with the op here. Do it in the caller and document why it's done there.
On Mon, Mar 03, 2025 at 07:23:01PM +0800, Jinliang Zheng wrote: > When recovering a large filesystem, avoid log recover IO being > throttled by rq_qos_throttle(). Why? The only writes to the journal during recovery are to clear stale blocks - it's only a very small part of the IO that journal recovery typically does. What problem happens when these writes are throttled? -Dave.
diff --git a/fs/xfs/xfs_bio_io.c b/fs/xfs/xfs_bio_io.c index fe21c76f75b8..259955f2aeb2 100644 --- a/fs/xfs/xfs_bio_io.c +++ b/fs/xfs/xfs_bio_io.c @@ -22,12 +22,15 @@ xfs_rw_bdev( unsigned int left = count; int error; struct bio *bio; + blk_opf_t opf = op | REQ_META | REQ_SYNC; if (is_vmalloc && op == REQ_OP_WRITE) flush_kernel_vmap_range(data, count); - bio = bio_alloc(bdev, bio_max_vecs(left), op | REQ_META | REQ_SYNC, - GFP_KERNEL); + if (op == REQ_OP_WRITE) + opf |= REQ_IDLE; + + bio = bio_alloc(bdev, bio_max_vecs(left), opf, GFP_KERNEL); bio->bi_iter.bi_sector = sector; do {
When recovering a large filesystem, avoid log recover IO being throttled by rq_qos_throttle(). Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com> --- fs/xfs/xfs_bio_io.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)