From: JeffleXu <[email protected]>
To: Mikulas Patocka <[email protected]>
Cc: [email protected], [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected], [email protected]
Subject: Re: [dm-devel] [PATCH v3 11/11] dm: fastpath of bio-based polling
Date: Wed, 3 Mar 2021 09:55:37 +0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <alpine.LRH.2.02.2103021353490.9353@file01.intranet.prod.int.rdu2.redhat.com>
On 3/3/21 3:03 AM, Mikulas Patocka wrote:
>
>
> On Fri, 26 Feb 2021, JeffleXu wrote:
>
>>
>>
>> On 2/20/21 3:38 AM, Mikulas Patocka wrote:
>>>
>>>
>>> On Mon, 8 Feb 2021, Jeffle Xu wrote:
>>>
>>>> Offer one fastpath of bio-based polling when bio submitted to dm device
>>>> is not split.
>>>>
>>>> In this case, there will be only one bio submitted to only one polling
>>>> hw queue of one underlying mq device, and thus we don't need to track
>>>> all split bios or iterate through all polling hw queues. The pointer to
>>>> the polling hw queue the bio submitted to is returned here as the
>>>> returned cookie.
>>>
>>> This doesn't seem safe - note that between submit_bio() and blk_poll(), no
>>> locks are held - so the device mapper device may be reconfigured
>>> arbitrarily. When you call blk_poll() with a pointer returned by
>>> submit_bio(), the pointer may point to a stale address.
>>>
>>
>> Thanks for the feedback. Indeed maybe it's not a good idea to directly
>> return a 'struct blk_mq_hw_ctx *' pointer as the returned cookie.
>>
>> Currently I have no idea to fix it, orz... The
>> blk_get_queue()/blk_put_queue() tricks may not work in this case.
>> Because the returned cookie may not be used at all. Before calling
>> blk_poll(), the polling routine may find that the corresponding IO has
>> already completed, and thus won't call blk_poll(), in which case we have
>> no place to put the refcount.
>>
>> But I really don't want to drop this optimization, since this
>> optimization is quite intuitive when dm device maps to a lot of
>> underlying devices. Though this optimization doesn't actually achieve
>> reasonable performance gain in my test, maybe because there are at most
>> seven nvme devices in my test machine.
>>
>> Any thoughts?
>>
>> Thanks,
>> Jeffle
>
> Hi
>
> I reworked device mapper polling, so that we poll in the function
> __split_and_process_bio. The pointer to a queue and the polling cookie is
> passed only inside device mapper code, it never leaves it.
>
> I'll send you my patches - try them and tell me how does it perform
> compared to your patchset.
>
Thanks. Be glad to hear that you're also working on this. I'm glad to
give some comments on your patch set.
--
Thanks,
Jeffle
next prev parent reply other threads:[~2021-03-03 6:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 8:52 [PATCH v3 00/11] dm: support IO polling Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 01/11] block: move definition of blk_qc_t to types.h Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 02/11] block: add queue_to_disk() to get gendisk from request_queue Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 03/11] block: add poll method to support bio-based IO polling Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 04/11] block: add poll_capable " Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 05/11] block/mq: extract one helper function polling hw queue Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 06/11] block/mq: add iterator for polling hw queues Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 07/11] dm: always return BLK_QC_T_NONE for bio-based device Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 08/11] dm: fix iterate_device sanity check Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 09/11] dm: support IO polling for bio-based dm device Jeffle Xu
2021-02-09 3:11 ` Ming Lei
2021-02-09 6:13 ` JeffleXu
2021-02-09 6:22 ` JeffleXu
2021-02-09 8:07 ` Ming Lei
2021-02-09 8:46 ` JeffleXu
2021-02-19 14:17 ` [dm-devel] " Mikulas Patocka
2021-02-24 1:42 ` JeffleXu
2021-02-26 8:22 ` JeffleXu
2021-02-08 8:52 ` [PATCH v3 10/11] nvme/pci: don't wait for locked polling queue Jeffle Xu
2021-02-08 8:52 ` [PATCH v3 11/11] dm: fastpath of bio-based polling Jeffle Xu
2021-02-19 19:38 ` [dm-devel] " Mikulas Patocka
2021-02-26 8:12 ` JeffleXu
2021-03-02 19:03 ` Mikulas Patocka
2021-03-03 1:55 ` JeffleXu [this message]
2021-02-17 13:15 ` [PATCH v3 00/11] dm: support IO polling JeffleXu
2021-03-10 20:01 ` Mike Snitzer
2021-03-11 7:07 ` [dm-devel] " JeffleXu
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=3ce93e18-190a-fb63-3efa-9d0d7119920c@linux.alibaba.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox