[RFC PATCH 2/2] block: support to freeze bio based request queue
Ming Lei
ming.lei at redhat.com
Thu Apr 15 14:56:11 BST 2021
On Thu, Apr 15, 2021 at 06:33:10PM +0800, Ming Lei wrote:
> For bio based request queue, the queue usage refcnt is only grabbed
> during submission, which isn't consistent with request base queue.
>
> Queue freezing has been used widely, and turns out it is very useful
> to quiesce queue activity.
>
> Support to freeze bio based request queue by the following approach:
>
> 1) grab two queue usage refcount for blk-mq before submitting blk-mq
> bio, one is for bio, anther is for request;
>
> 2) add bio flag of BIO_QUEUE_REFFED for making sure that only one
> refcnt is grabbed for each bio, so we can put the refcnt when the
> bio is going away
>
> 3) nvme mpath is a bit special, because same bio is used for both
> mpath queue and underlying nvme queue. So we put the mpath queue's
> usage refcnt before completing the nvme request.
RAID needs similar handling too, but it is easy to do, see md_end_io().
--
Ming
More information about the Linux-nvme
mailing list