On 7/2/18 3:36 AM, Ming Lei wrote: > It won't be efficient to dequeue request one by one from sw queue, > but we have to do that when queue is busy for better merge performance. > > This patch takes EWMA to figure out if queue is busy, then only dequeue > request one by one from sw queue when queue is busy. Just one minor comment, since you're going to be updating this one anyway: > @@ -1209,8 +1234,11 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, > else if (needs_restart && (ret == BLK_STS_RESOURCE)) > blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY); > > + blk_mq_update_hctx_busy(hctx, true); > + > return false; Kill that newline between update and return. Rest looks fine to me now, though I do agree with Christophs comments on making the weight and factor in caps. Applying 1-2/3 so far. -- Jens Axboe