summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorHou Tao <houtao1@huawei.com>2019-05-21 09:59:04 +0200
committerJens Axboe <axboe@kernel.dk>2019-09-16 00:02:10 +0200
commit9a91b05bba58e5bd83034e69407d11641e8064e9 (patch)
treec34f358f4b21023c234beb88a43d473e361f8a6f /block
parentblock: make rq sector size accessible for block stats (diff)
downloadlinux-9a91b05bba58e5bd83034e69407d11641e8064e9.tar.xz
linux-9a91b05bba58e5bd83034e69407d11641e8064e9.zip
block: also check RQF_STATS in blk_mq_need_time_stamp()
In __blk_mq_end_request() if block stats needs update, we should ensure now is valid instead of 0 even when iostat is disabled. Signed-off-by: Hou Tao <houtao1@huawei.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index d30fabb583fd..214ed0739aa5 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -282,12 +282,12 @@ bool blk_mq_can_queue(struct blk_mq_hw_ctx *hctx)
EXPORT_SYMBOL(blk_mq_can_queue);
/*
- * Only need start/end time stamping if we have stats enabled, or using
- * an IO scheduler.
+ * Only need start/end time stamping if we have iostat or
+ * blk stats enabled, or using an IO scheduler.
*/
static inline bool blk_mq_need_time_stamp(struct request *rq)
{
- return (rq->rq_flags & RQF_IO_STAT) || rq->q->elevator;
+ return (rq->rq_flags & (RQF_IO_STAT | RQF_STATS)) || rq->q->elevator;
}
static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,