diff mbox series

block: skip start/end time stamping for passthrough IO

Message ID 20231221111221.4237-1-kundan.kumar@samsung.com (mailing list archive)
State New, archived
Headers show
Series block: skip start/end time stamping for passthrough IO | expand

Commit Message

Kundan Kumar Dec. 21, 2023, 11:12 a.m. UTC
This patch will avoid start/end time stamping for passthrough IO.
This helps to improve IO performance by ~7%

Signed-off-by: Kundan Kumar <kundan.kumar@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
---
 include/linux/blk-mq.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jens Axboe Dec. 21, 2023, 3:24 p.m. UTC | #1
On 12/21/23 4:12 AM, Kundan Kumar wrote:
> This patch will avoid start/end time stamping for passthrough IO.
> This helps to improve IO performance by ~7%

This commit message needs to explain why we don't need to do
timestamping for passthrough, rather than just say what the win is.

> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> index 1ab3081c82ed..04617494db7e 100644
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -830,7 +830,8 @@ void blk_mq_end_request_batch(struct io_comp_batch *ib);
>   */
>  static inline bool blk_mq_need_time_stamp(struct request *rq)
>  {
> -	return (rq->rq_flags & (RQF_IO_STAT | RQF_STATS | RQF_USE_SCHED));
> +	return (rq->rq_flags & (RQF_IO_STAT | RQF_STATS | RQF_USE_SCHED) &&
> +		!blk_rq_is_passthrough(rq));
>  }
>  
>  static inline bool blk_mq_is_reserved_rq(struct request *rq)

I feel like this would be cleaner with a bit of separation:

static inline bool blk_mq_need_time_stamp(struct request *rq)
{
	/* comment on why passthrough is excempt */
	if (blk_rq_is_passthrough(rq))
		return false;
	return (rq->rq_flags & (RQF_IO_STAT | RQF_STATS | RQF_USE_SCHED));
}

or something like that.
diff mbox series

Patch

diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 1ab3081c82ed..04617494db7e 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -830,7 +830,8 @@  void blk_mq_end_request_batch(struct io_comp_batch *ib);
  */
 static inline bool blk_mq_need_time_stamp(struct request *rq)
 {
-	return (rq->rq_flags & (RQF_IO_STAT | RQF_STATS | RQF_USE_SCHED));
+	return (rq->rq_flags & (RQF_IO_STAT | RQF_STATS | RQF_USE_SCHED) &&
+		!blk_rq_is_passthrough(rq));
 }
 
 static inline bool blk_mq_is_reserved_rq(struct request *rq)