On Fri, Aug 10, 2018 at 10:59:37AM +0800, jianchao.wang wrote: > Hi Omar > > On 08/10/2018 04:26 AM, Omar Sandoval wrote: > > @@ -524,6 +524,9 @@ inline void __blk_mq_end_request(struct request *rq, blk_status_t error) > > blk_stat_add(rq, now); > > } > > > > + if (rq->internal_tag != -1) > > + blk_mq_sched_completed_request(rq, now); > > + > > Is it OK to move the io scheduler completed callback into __blk_mq_end_request ? It's ok in the sense that only Kyber uses it. > There is a relatively long distance between the __blk_mq_complete_request and __blk_mq_end_request, > especially the driver's mq_ops.complete and the bio_endio. That's a fair point. We could maybe consolidate all of the I/O time measurements to __blk_mq_complete_request() and have a separate callback for the total time measurement in __blk_mq_end_request(), but I'm not sure it's worth adding another hook for that.