public inbox for [email protected]
 help / color / mirror / Atom feed
From: David Sterba <[email protected]>
To: Mark Harmstone <[email protected]>
Cc: [email protected], [email protected]
Subject: Re: [PATCH v2] btrfs: add io_uring interface for encoded writes
Date: Mon, 13 Jan 2025 21:09:19 +0100	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On Fri, Jan 10, 2025 at 05:23:52PM +0000, Mark Harmstone wrote:
> Add an io_uring interface for encoded writes, with the same parameters
> as the BTRFS_IOC_ENCODED_WRITE ioctl.
> 
> As with the encoded reads code, there's a test program for this at
> https://github.com/maharmstone/io_uring-encoded, and I'll get this
> worked into an fstest.
> 
> How io_uring works is that it initially calls btrfs_uring_cmd with the
> IO_URING_F_NONBLOCK flag set, and if we return -EAGAIN it tries again in
> a kthread with the flag cleared.
> 
> Ideally we'd honour this and call try_lock etc., but there's still a lot
> of work to be done to create non-blocking versions of all the functions
> in our write path. Instead, just validate the input in
> btrfs_uring_encoded_write() on the first pass and return -EAGAIN, with a
> view to properly optimizing the happy path later on.
> 
> Signed-off-by: Mark Harmstone <[email protected]>
> ---
> Changelog:
> * Version 2: switched to using io_uring_cmd_get_async_data, so that we
> only copy from userspace once

I've added this to for-next now, it hasn't been in linux-next so far but
we have at least one week before the merge window. The io_uring+read is
about to be released and there's no reason to delay the write for one
whole dev cycle. Any fixups please send as separate patches. Thanks.

      reply	other threads:[~2025-01-13 20:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10 17:23 [PATCH v2] btrfs: add io_uring interface for encoded writes Mark Harmstone
2025-01-13 20:09 ` David Sterba [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