All of lore.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@fb.com>, kernel-team@fb.com
Subject: [PATCH 6/7] block: move blk_stat_add() to __blk_mq_end_request()
Date: Wed,  2 May 2018 10:34:25 -0700	[thread overview]
Message-ID: <cd489c632d7294cdc41603008777c472ae183c55.1525282392.git.osandov@fb.com> (raw)
In-Reply-To: <cover.1525282392.git.osandov@fb.com>
In-Reply-To: <cover.1525282392.git.osandov@fb.com>

From: Omar Sandoval <osandov@fb.com>

We want this next to blk_account_io_done() for the next change so that
we can call ktime_get() only once for both.

Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 block/blk-mq.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 9fa8069af032..65141edda189 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -490,6 +490,11 @@ EXPORT_SYMBOL_GPL(blk_mq_free_request);
 
 inline void __blk_mq_end_request(struct request *rq, blk_status_t error)
 {
+	if (rq->rq_flags & RQF_STATS) {
+		blk_mq_poll_stats_start(rq->q);
+		blk_stat_add(rq);
+	}
+
 	blk_account_io_done(rq);
 
 	if (rq->end_io) {
@@ -529,10 +534,6 @@ static void __blk_mq_complete_request(struct request *rq)
 
 	if (rq->internal_tag != -1)
 		blk_mq_sched_completed_request(rq);
-	if (rq->rq_flags & RQF_STATS) {
-		blk_mq_poll_stats_start(rq->q);
-		blk_stat_add(rq);
-	}
 
 	if (!test_bit(QUEUE_FLAG_SAME_COMP, &rq->q->queue_flags)) {
 		rq->q->softirq_done_fn(rq);
-- 
2.17.0

  parent reply	other threads:[~2018-05-02 17:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 17:34 [PATCH 0/7] block: consolidate struct request timestamp fields Omar Sandoval
2018-05-02 17:34 ` [PATCH 1/7] block: move some wbt helpers to blk-wbt.c Omar Sandoval
2018-05-02 17:34 ` [PATCH 2/7] block: pass struct request instead of struct blk_issue_stat to wbt Omar Sandoval
2018-05-02 17:34 ` [PATCH 3/7] block: replace bio->bi_issue_stat with u64 Omar Sandoval
2018-05-02 17:34 ` [PATCH 4/7] block: get rid of struct blk_issue_stat Omar Sandoval
2018-05-02 17:34 ` [PATCH 5/7] block: use ktime_get_ns() instead of sched_clock() for cfq and bfq Omar Sandoval
2018-05-02 17:34 ` Omar Sandoval [this message]
2018-05-02 17:34 ` [PATCH 7/7] block: consolidate struct request timestamp fields Omar Sandoval

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=cd489c632d7294cdc41603008777c472ae183c55.1525282392.git.osandov@fb.com \
    --to=osandov@osandov.com \
    --cc=axboe@fb.com \
    --cc=kernel-team@fb.com \
    --cc=linux-block@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.