linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Qian Cai <cai@lca.pw>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>,
	m.szyprowski@samsung.com
Subject: Re: [PATCH V3 3/3] blk-mq: centralise related handling into blk_mq_get_driver_tag
Date: Thu, 2 Jul 2020 14:20:41 +0800	[thread overview]
Message-ID: <20200702062041.GC2452799@T590> (raw)
In-Reply-To: <20200702043721.GA1087@lca.pw>

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@infradead.org>
> > Signed-off-by: Ming Lei <ming.lei@redhat.com>
> 
> 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


  reply	other threads:[~2020-07-02  6:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 14:03 [PATCH V3 0/3] blk-mq: driver tag related cleanup Ming Lei
2020-06-30 14:03 ` [PATCH V3 1/3] blk-mq: move blk_mq_get_driver_tag into blk-mq.c Ming Lei
2020-06-30 14:03 ` [PATCH V3 2/3] blk-mq: move blk_mq_put_driver_tag() " Ming Lei
2020-06-30 14:03 ` [PATCH V3 3/3] blk-mq: centralise related handling into blk_mq_get_driver_tag Ming Lei
2020-07-02  4:37   ` Qian Cai
2020-07-02  6:20     ` Ming Lei [this message]
2020-06-30 18:58 ` [PATCH V3 0/3] blk-mq: driver tag related cleanup Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200702062041.GC2452799@T590 \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=cai@lca.pw \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).