Skip to contentSkip to conversation

block: skip start/end time stamping for passthrough IO

PATCH Applied Kundan Kumar 2 participants 2 messages Dec 22, 2023 1 message not in the archive Block layer

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20231222102344epcas5p43711f96bd85104cfcb3e3a1fab5eeaee@epcas5p4.samsung.com

#1 lore raw

PATCH v2 1/1 block: skip start/end time stamping for passthrough IO

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%

---
Changes compared to v1:
- Modified commit description.
- Made code cleaner with bit of separation.

 include/linux/blk-mq.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/blk-mq.h +6 -0
index 1ab3081c82ed..a676e116085f 100644
@@ -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));
 }
 
Signature · 1 line
2.25.1
maintainer Applied
#2 lore raw
Quoted 8 lines · Kundan Kumar

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%

[...]

Applied, thanks!

[1/1] block: skip start/end time stamping for passthrough IO

      commit: 8e6e83d77227d9ba39e0c7b50693f1b4f8728006

Best regards,

Signature · 1 line
Jens Axboe