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: > > 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@xxxxxxxxxxxxx> > > Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> > > 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