]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: insert flush request to the front of dispatch queue
authorMing Lei <ming.lei@redhat.com>
Thu, 12 Mar 2020 09:15:48 +0000 (17:15 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Mar 2020 13:26:12 +0000 (07:26 -0600)
commitbba92423f4b9d3e6620d77fef21074e70c86b5b8
tree8a1e91837c3b5279619760b679de340b26460d47
parentf39ab9169800bf0f7a2b54f0d0ae9b7821eeaf50
blk-mq: insert flush request to the front of dispatch queue

commit 94adf1ff1abe ("blk-mq: insert passthrough request into
hctx->dispatch directly") may change to add flush request to the tail
of dispatch by applying the 'add_head' parameter of
blk_mq_sched_insert_request.

Turns out this way causes performance regression on NCQ controller because
flush is non-NCQ command, which can't be queued when there is any in-flight
NCQ command. When adding flush rq to the front of hctx->dispatch, it is
easier to introduce extra time to flush rq's latency compared with adding
to the tail of dispatch queue because of S_SCHED_RESTART, then chance of
flush merge is increased, and less flush requests may be issued to
controller.

So always insert flush request to the front of dispatch queue just like
before applying commit 94adf1ff1abe ("blk-mq: insert passthrough request
into hctx->dispatch directly").

Cc: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fixes: 94adf1ff1abe ("blk-mq: insert passthrough request into hctx->dispatch directly")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-sched.c