Skip to content

Commit

Permalink
block: skip QUEUE_FLAG_STATS and rq-qos for passthrough io
Browse files Browse the repository at this point in the history
Write-back throttling (WBT) enables QUEUE_FLAG_STATS on the request
queue. But WBT does not make sense for passthrough io, so skip
QUEUE_FLAG_STATS processing.

Also skip rq_qos_issue/done for passthrough io.

Overall, the change gives ~11% hike in peak performance.

Signed-off-by: Kundan Kumar <kundan.kumar@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Link: https://lore.kernel.org/r/20231123190331.7934-1-kundan.kumar@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Kundan Kumar authored and Jens Axboe committed Dec 2, 2023
1 parent 8fadb86 commit 847c5bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,8 @@ void blk_mq_start_request(struct request *rq)

trace_block_rq_issue(rq);

if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags)) {
if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags) &&
!blk_rq_is_passthrough(rq)) {
rq->io_start_time_ns = ktime_get_ns();
rq->stats_sectors = blk_rq_sectors(rq);
rq->rq_flags |= RQF_STATS;
Expand Down
2 changes: 1 addition & 1 deletion block/blk-rq-qos.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static inline void rq_qos_cleanup(struct request_queue *q, struct bio *bio)

static inline void rq_qos_done(struct request_queue *q, struct request *rq)
{
if (q->rq_qos)
if (q->rq_qos && !blk_rq_is_passthrough(rq))
__rq_qos_done(q->rq_qos, rq);
}

Expand Down

0 comments on commit 847c5bc

Please sign in to comment.