]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: avoid extending delays of active hctx from blk_mq_delay_run_hw_queues
authorDavid Jeffery <djeffery@redhat.com>
Mon, 31 Jan 2022 20:33:37 +0000 (15:33 -0500)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Feb 2022 02:46:20 +0000 (19:46 -0700)
commitf0c333c5f85e01b7806e5f54469e9042374d869c
tree14b56b2ad90ec08017df5ee33e983113dc89102d
parent8a82286a752f88c49d1e5f7fde11d91ef382f1d3
blk-mq: avoid extending delays of active hctx from blk_mq_delay_run_hw_queues

When blk_mq_delay_run_hw_queues sets an hctx to run in the future, it can
reset the delay length for an already pending delayed work run_work. This
creates a scenario where multiple hctx may have their queues set to run,
but if one runs first and finds nothing to do, it can reset the delay of
another hctx and stall the other hctx's ability to run requests.

To avoid this I/O stall when an hctx's run_work is already pending,
leave it untouched to run at its current designated time rather than
extending its delay. The work will still run which keeps closed the race
calling blk_mq_delay_run_hw_queues is needed for while also avoiding the
I/O stall.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220131203337.GA17666@redhat
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c