From: Christoph Hellwig <hch@lst.de>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
Ming Lei <ming.lei@redhat.com>, Hannes Reinecke <hare@suse.com>,
Omar Sandoval <osandov@fb.com>
Subject: Re: [PATCH 1/2] blk-mq: Remove blk_mq_put_ctx()
Date: Tue, 11 Jun 2019 10:09:51 +0200 [thread overview]
Message-ID: <20190611080951.GC21815@lst.de> (raw)
In-Reply-To: <8b179799-5381-1b47-1793-f1fd39726d49@acm.org>
On Mon, Jun 10, 2019 at 03:00:39PM -0700, Bart Van Assche wrote:
> 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?
Yes. But we still have additional blk_mq_get_ctx calls that I was
concerned about. But looking deeper it seems like the additional ones are
just used locally for I/O scheduler merge decisions, and we should be ok
even if the context changes due to a preemption between the failed merge
and the request allocation. That being said it would still be nice
to pass the ctx from __blk_mq_sched_bio_merge to ->bio_merge instead
of having to find it again in kyber_bio_merge, but that isn't urgent.
next prev parent reply other threads:[~2019-06-11 8:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-04 18:17 [PATCH 0/2] Simplify blk-mq implementation Bart Van Assche
2019-06-04 18:17 ` [PATCH 1/2] blk-mq: Remove blk_mq_put_ctx() Bart Van Assche
2019-06-08 8:19 ` Christoph Hellwig
2019-06-10 22:00 ` Bart Van Assche
2019-06-11 8:09 ` Christoph Hellwig [this message]
2019-06-04 18:17 ` [PATCH 2/2] blk-mq: Simplify blk_mq_make_request() Bart Van Assche
-- strict thread matches above, loose matches on Subject: below --
2019-07-01 15:47 [PATCH, RESEND 0/2] Simplify blk-mq implementation Bart Van Assche
2019-07-01 15:47 ` [PATCH 1/2] blk-mq: Remove blk_mq_put_ctx() Bart Van Assche
2019-07-02 13:25 ` Christoph Hellwig
2019-07-02 13:25 ` Christoph Hellwig
2019-07-03 2:45 ` Ming Lei
2019-07-03 15:06 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190611080951.GC21815@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hare@suse.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=osandov@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.