public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Christoph Hellwig <[email protected]>
Cc: "[email protected]" <[email protected]>,
	io-uring <[email protected]>
Subject: Re: [PATCH RFC] Enable bio cache for IRQ driven IO from io_uring
Date: Thu, 19 Aug 2021 09:15:06 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 8/19/21 3:01 AM, Christoph Hellwig wrote:
> On Wed, Aug 18, 2021 at 10:54:45AM -0600, Jens Axboe wrote:
>> We previously enabled this for O_DIRECT polled IO, however io_uring
>> completes all IO from task context these days, so it can be enabled for
>> that path too. This requires moving the bio_put() from IRQ context, and
>> this can be accomplished by passing the ownership back to the issuer.
>>
>> Use kiocb->private for that, which should be (as far as I can tell) free
>> once we get to the completion side of things. Add a IOCB_PUT_CACHE flag
>> to tell the issuer that we passed back the ownership, then the issuer
>> can put the bio from a safe context.
>>
>> Like the polled IO ditto, this is good for a 10% performance increase.
>>
>> Signed-off-by: Jens Axboe <[email protected]>
>>
>> ---
>>
>> Just hacked this up and tested it, Works For Me. Would welcome input on
>> alternative methods here, if anyone has good suggestions.
> 
> 10% performance improvement looks really nice, but I don't think we can
> just hardcode assumptions about bios in iomap->private.  The easiest
> would be to call back into the file systems for the freeing, but that
> would add an indirect call.

That's why it's an RFC - while it's not the prettiest, the ->ki_complete
assigner is also the one that sets IOCB_ALLOC_CACHE, and hence it's not
that hard to verify that it does IOCB_PUT_CACHE correctly too. That
said, I would prefer a better way of passing the bio back. There are
other optimizations that could be done if we do that. But I have no good
ideas on how to do the passing differently right now.

-- 
Jens Axboe


      reply	other threads:[~2021-08-19 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 16:54 [PATCH RFC] Enable bio cache for IRQ driven IO from io_uring Jens Axboe
2021-08-19  9:01 ` Christoph Hellwig
2021-08-19 15:15   ` Jens Axboe [this message]

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 \
    [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