mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Pavel Begunkov (Silence)" <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Pavel Begunkov <asml.silence@gmail.com>
Subject: [PATCH 3/7] blk-mq: Fix disabled hybrid polling
Date: Tue, 30 Apr 2019 10:34:15 +0300	[thread overview]
Message-ID: <87e3f35a44cf987cc71a8dcc38238bc61164fb11.1556609582.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1556609582.git.asml.silence@gmail.com>

From: Pavel Begunkov <asml.silence@gmail.com>

Commit 4bc6339a583cec650b05 ("block: move blk_stat_add() to
__blk_mq_end_request()") moved blk_stat_add(), so now it's called after
blk_update_request(), which zeroes rq->__data_len. Without length,
blk_stat_add() can't calculate stat bucket and returns error,
effectively disabling hybrid polling.

Move it back to __blk_mq_complete_request.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 block/blk-mq.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index fc60ed7e940e..cc3f73e4e01c 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -535,11 +535,6 @@ inline void __blk_mq_end_request(struct request *rq, blk_status_t error)
 	if (blk_mq_need_time_stamp(rq))
 		now = ktime_get_ns();
 
-	if (rq->rq_flags & RQF_STATS) {
-		blk_mq_poll_stats_start(rq->q);
-		blk_stat_add(rq, now);
-	}
-
 	if (rq->internal_tag != -1)
 		blk_mq_sched_completed_request(rq, now);
 
@@ -578,6 +573,11 @@ static void __blk_mq_complete_request(struct request *rq)
 	int cpu;
 
 	WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
+
+	if (rq->rq_flags & RQF_STATS) {
+		blk_mq_poll_stats_start(rq->q);
+		blk_stat_add(rq, ktime_get_ns());
+	}
 	/*
 	 * Most of single queue controllers, there is only one irq vector
 	 * for handling IO completion, and the only irq's affinity is set
-- 
2.21.0


  parent reply	other threads:[~2019-04-30  7:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30  7:34 [PATCH 0/7] Adjust hybrid polling sleep time Pavel Begunkov (Silence)
2019-04-30  7:34 ` [PATCH 1/7] blk-iolatency: Fix zero mean in previous stats Pavel Begunkov (Silence)
2019-04-30  7:34 ` [PATCH 2/7] blk-stats: Introduce explicit stat staging buffers Pavel Begunkov (Silence)
2019-04-30  7:34 ` Pavel Begunkov (Silence) [this message]
2019-04-30  7:34 ` [PATCH 4/7] blk-stats: Add left mean deviation to blk_stats Pavel Begunkov (Silence)
2019-04-30  7:34 ` [PATCH 5/7] blk-mq: Precalculate hybrid polling time Pavel Begunkov (Silence)
2019-04-30  7:34 ` [PATCH 6/7] blk-mq: Track num of overslept by hybrid poll rqs Pavel Begunkov (Silence)
2019-04-30  7:34 ` [PATCH 7/7] blk-mq: Adjust hybrid poll sleep time Pavel Begunkov (Silence)
2019-05-24  9:06 ` [PATCH 0/7] Adjust hybrid polling " Pavel Begunkov

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=87e3f35a44cf987cc71a8dcc38238bc61164fb11.1556609582.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®