On 6/8/19 1:19 AM, Christoph Hellwig wrote:
On Tue, Jun 04, 2019 at 11:17:35AM -0700, Bart Van Assche wrote:
No code that occurs between blk_mq_get_ctx() and blk_mq_put_ctx() depends
on preemption being disabled for its correctness. Since removing the CPU
preemption calls does not measurably affect performance, simplify the
blk-mq code by removing the blk_mq_put_ctx() function and also by not
disabling preemption in blk_mq_get_ctx().
I like the idea behinds this, but I think it makes some small issues
we have in the current code even worse. As far as I can tell the idea
behind this call was that we operate on the same blk_mq_ctx for the
duration of the I/O submission. Now it should not matter which one,
that is we don't care if we get preempted, but it should stay the same.
Hi Christoph,
Can you clarify this? Isn't the goal of the rq->mq_ctx = data->ctx
assignment in blk_mq_rq_ctx_init() to ensure that the same blk_mq_ctx is
used during I/O submission? As you know blk_mq_rq_ctx_init() is called
immediately after a tag has been allocated.
To actually make this work properly we'll need to pass down the
blk_mq_ctx into the I/O scheduler merge path, which dereference it.
Note that I also have an outstanding series to pass down an additional
parameter there (the bi_phys_segments removal) so we'll need to
coordinate that.
I can wait until Jens has queued your patch series.
Thanks,
Bart.