Re: [PATCH V3 3/3] blk-mq: centralise related handling into blk_mq_get_driver_tag
From: Ming Lei <hidden>
Date: 2020-07-02 06:21:00
Subsystem:
block layer, the rest · Maintainers:
Jens Axboe, Linus Torvalds
From: Ming Lei <hidden>
Date: 2020-07-02 06:21:00
Subsystem:
block layer, the rest · Maintainers:
Jens Axboe, Linus Torvalds
On Thu, Jul 02, 2020 at 12:37:21AM -0400, Qian Cai wrote:
On Tue, Jun 30, 2020 at 10:03:57PM +0800, Ming Lei wrote:quoted
Move .nr_active update and request assignment into blk_mq_get_driver_tag(), all are good to do during getting driver tag. Meantime blk-flush related code is simplified and flush request needn't to update the request table manually any more. Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Ming Lei <redacted>Reverting this commit on the top of next-20200701 fixed an issue where swapping is unable to move progress for hours while it will only take 5-min after the reverting.
Hi Qian, Could you apply the following patch and see if it makes a difference?
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 65e0846fd065..e89ce9ae51fd 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c@@ -1147,7 +1147,8 @@ static bool blk_mq_get_driver_tag(struct request *rq) if (rq->tag == BLK_MQ_NO_TAG && !__blk_mq_get_driver_tag(rq)) return false; - if (hctx->flags & BLK_MQ_F_TAG_SHARED) { + if ((hctx->flags & BLK_MQ_F_TAG_SHARED) && + !(rq->rq_flags & RQF_MQ_INFLIGHT)) { rq->rq_flags |= RQF_MQ_INFLIGHT; atomic_inc(&hctx->nr_active); }
Thanks, Ming