block/mq-deadline: serialize request dispatching
authorJens Axboe <axboe@kernel.dk>
Thu, 18 Jan 2024 17:46:52 +0000 (10:46 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 1 Apr 2024 22:03:34 +0000 (16:03 -0600)
commitea07e33ddbf5b41cafec9a7189bc2a7f079b3caf
tree93de777489f97e9b77d7a43e7b1bbcf8a1068a87
parent415ab89f440f1abb988003eef2525f0b52a6be55
block/mq-deadline: serialize request dispatching

If we're entering request dispatch but someone else is already
dispatching, then just skip this dispatch. We know IO is inflight and
this will trigger another dispatch event for any completion. This will
potentially cause slightly lower queue depth for contended cases, but
those are slowed down anyway and this should not cause an issue.

By itself, this patch doesn't help a whole lot, as the dispatch
lock contention reduction is just eating up by the same dd->lock now
seeing increased insertion contention. But it's required work to be
able to reduce the lock contention in general.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/mq-deadline.c