block: skip start/end time stamping for passthrough IO
authorKundan Kumar <kundan.kumar@samsung.com>
Fri, 22 Dec 2023 10:17:07 +0000 (15:47 +0530)
committerJens Axboe <axboe@kernel.dk>
Fri, 22 Dec 2023 14:14:15 +0000 (07:14 -0700)
commit 41fa722239b4 ("blk-mq: do not include passthrough requests in I/O
accounting")' disables I/O accounting for passthrough requests. Since tools
like 'iostat' do not show anything useful for passthrough I/O, it's
wasteful to do start/end time-stamping. So do away with that.

Avoiding the time-stamping improves the I/O performance by ~7%

Signed-off-by: Kundan Kumar <kundan.kumar@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Link: https://lore.kernel.org/r/20231222101707.6921-1-kundan.kumar@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/blk-mq.h

index 1ab3081c82edaedab451ed44d4d2a84f88b3f4d5..a676e116085f331ed8bb03208ce7f744a8376f21 100644 (file)
@@ -830,6 +830,12 @@ void blk_mq_end_request_batch(struct io_comp_batch *ib);
  */
 static inline bool blk_mq_need_time_stamp(struct request *rq)
 {
+       /*
+        * passthrough io doesn't use iostat accounting, cgroup stats
+        * and io scheduler functionalities.
+        */
+       if (blk_rq_is_passthrough(rq))
+               return false;
        return (rq->rq_flags & (RQF_IO_STAT | RQF_STATS | RQF_USE_SCHED));
 }