Thread (12 messages) 12 messages, 4 authors, 2021-11-12

Re: [PATCH] blk-mq: setup blk_mq_alloc_data.cmd_flags after submit_bio_checks() is done

From: Jens Axboe <axboe@kernel.dk>
Date: 2021-11-12 15:41:26

On 11/12/21 1:44 AM, Christoph Hellwig wrote:
On Fri, Nov 12, 2021 at 04:37:19PM +0800, Ming Lei wrote:
quoted
quoted
can only be used for reads, and no fua can be set if the preallocating
I/O didn't use fua, etc.

What are the pitfalls of just chanigng cmd_flags?
Then we need to check cmd_flags carefully, such as hctx->type has to
be same, flush & passthrough flags has to be same, that said all
->cmd_flags used for allocating rqs have to be same with the following
bio->bi_opf.

In usual cases, I guess all IOs submitted from same plug batch should be
same type. If not, we can switch to change cmd_flags.
Jens: is this a limit fitting into your use cases?
It's not a big problem for my use case, as that ones all the same type
of IO. And in general I don't expect a lot of mixed uses here, I guess
the main issue might be a plug for writes and an initial meta data read
will "polute" the request cache with requests that we won't be using.
But probably not a big enough thing to worry about in terms of
efficiency.
I guess as a quick fix this rejecting different flags is probably the
best we can do for now, but I suspect we'll want to eventually relax
them.
Agree on both.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help