Re: [PATCH v7 2/9] block: record I/O request start time for passthru request

Hannes Reinecke <[email protected]>
Newsgroups org.infradead.lists.linux-nvme
Message-ID <[email protected]>
On 8/9/26 12:07 PM, Nilay Shroff wrote:
> While starting an I/O request, blk_mq_start_request() records the
> request start timestamp only for non-passthrough requests when
> QUEUE_FLAG_STATS is enabled.
> 
> However, the latency based multipath policy uses request completion
> latency to evaluate path performance, and I/O is issued as passthrough
> requests. Since passthru requests never initialize rq->io_start_time_ns,
> their latency cannot be computed.
> 
> Record io_start_time_ns for all requests whenever QUEUE_FLAG_STATS is
> enabled.
> 
> Signed-off-by: Nilay Shroff <[email protected]>
> ---
>   block/blk-mq.c | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/block/blk-mq.c b/block/blk-mq.c
> index 2c850330a32b..38922209a24f 100644
> --- a/block/blk-mq.c
> +++ b/block/blk-mq.c
> @@ -1340,12 +1340,14 @@ void blk_mq_start_request(struct request *rq)
>   
>   	trace_block_rq_issue(rq);
>   
> -	if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags) &&
> -	    !blk_rq_is_passthrough(rq)) {
> +	if (test_bit(QUEUE_FLAG_STATS, &q->queue_flags)) {
>   		rq->io_start_time_ns = blk_time_get_ns();
> -		rq->stats_sectors = blk_rq_sectors(rq);
> -		rq->rq_flags |= RQF_STATS;
> -		rq_qos_issue(q, rq);
> +
> +		if (!blk_rq_is_passthrough(rq)) {
> +			rq->stats_sectors = blk_rq_sectors(rq);
> +			rq->rq_flags |= RQF_STATS;
> +			rq_qos_issue(q, rq);
> +		}
>   	}
>   
>   	WARN_ON_ONCE(blk_mq_rq_state(rq) != MQ_RQ_IDLE);

Reviewed-by: Hannes Reinecke <[email protected]>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.