blk-mq: dequeue request one by one from sw queue if hctx is busy
authorMing Lei <ming.lei@redhat.com>
Tue, 3 Jul 2018 15:03:16 +0000 (09:03 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Jul 2018 15:07:53 +0000 (09:07 -0600)
commit6e768717304bdbe8d2897ca8298f6b58863fdc41
tree64f259002c9bcca0bd1f187cdd7d067e68a29d45
parentd893ff86034f7107f89d8b740c2b5902a21a49db
blk-mq: dequeue request one by one from sw queue if hctx is busy

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 the Exponential Weighted Moving Average(EWMA) to figure
out if queue is busy, then only dequeue request one by one from sw queue
when queue is busy.

Fixes: b347689ffbca ("blk-mq-sched: improve dispatching from sw queue")
Cc: Kashyap Desai <kashyap.desai@broadcom.com>
Cc: Laurence Oberman <loberman@redhat.com>
Cc: Omar Sandoval <osandov@fb.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Hannes Reinecke <hare@suse.de>
Reported-by: Kashyap Desai <kashyap.desai@broadcom.com>
Tested-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-debugfs.c
block/blk-mq-sched.c
block/blk-mq.c
include/linux/blk-mq.h