Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for io_uring API? #8716

Open
Harvie opened this issue May 6, 2019 · 13 comments
Open

Support for io_uring API? #8716

Harvie opened this issue May 6, 2019 · 13 comments
Labels
Type: Feature Feature request or new feature Type: Performance Performance improvement or performance problem

Comments

@Harvie
Copy link

Harvie commented May 6, 2019

I've noticed this new io_uring buzz going on, as it was released in Linux 5.1. They claim "up to two times performance gain on CEPH". It should improve multiqueue scalability for NVMe drives. Also the new API is supposed to be easier to use than currently used AIO API. So naturaly as enthusiastic ZFS user, i can't do better but ask what are the consequences for ZFS on Linux.

Is it likely that we will get some performance boost from this?
Is this hard to implement at ZoL side?

@behlendorf behlendorf added Type: Feature Feature request or new feature Type: Performance Performance improvement or performance problem labels May 6, 2019
@behlendorf
Copy link
Contributor

This is definitely an interface we'll want to investigate supporting.

@JonKohler
Copy link

Stumbled upon this today, has anyone given this a poke?

A few interesting thoughts - now that 5.4 long term is out and cooking, more people may feel comfortable getting on to a long term version of linux that has io_uring. Secondarily, Ubuntu 20.04 said that they're standardizing around 5.4.

The "buzz" @Harvie mentioned seems to still be buzzing

@Harvie
Copy link
Author

Harvie commented Jun 1, 2020

I think i still do not fully understand how io_uring works... Initialy i was thinking that io_uring would lay between ZFS and harddrive, but now somebody told me it is gonna lay between ZFS and userspace application, so i am bit confused. Do you know more about how this actualy works?

@maxximino
Copy link
Contributor

Is this actually relevant for ZFS? AFAIU io_uring is an interface between userspace applications and the kernel.
ZFS data paths between userspace and the kernel that I'm aware of are:

  • Filesystem IO - that's an interface managed by the kernel, and I can't spot in kernel 5.7 fs/ dir any filesystem-specific io_uring code.
    Looking deeper, https://github.com/torvalds/linux/blob/1ee08de1e234d95b5b4f866878b72fceb5372904/fs/io_uring.c#L2607 should call

    zpl_iter_read(struct kiocb *kiocb, struct iov_iter *to)
    {
    ssize_t ret;
    uio_seg_t seg = UIO_USERSPACE;
    if (to->type & ITER_KVEC)
    seg = UIO_SYSSPACE;
    if (to->type & ITER_BVEC)
    seg = UIO_BVEC;
    ret = zpl_iter_read_common(kiocb, to->iov, to->nr_segs,
    iov_iter_count(to), seg, to->iov_offset);
    if (ret > 0)
    iov_iter_advance(to, ret);
    return (ret);
    }
    (and it has a fallback in case we didn't implement it - so looks like doesn't expect integration work for every FS)

  • Block devices/zvol IO - same as above, checked drivers/block/, no sign of anything special . Didn't follow the exact code path for block devices.

  • ZFS send/receive: AFAIU that's one long-running IOCTL which dumps data directly into a file descriptor, so might not benefit from the reduced context switching of io_uring. (but this is just my speculation)

Ceph instead got huge performance gains because Ceph's ""backend"" is an userspace application which issues a lot of I/Os (see ceph/ceph#27392). Hypotethically, if ZoL was not a native kernel module but still zfs-fuse, that would gain performance.

@sistemas-sn
Copy link

Hi, how are you? any news about this?. This will be a great feature for improves zfs performance.

@recklessnl
Copy link

It's coming up to 3 years since this post - @behlendorf has there been any progress or updates with regards to io_uring?

@gigatexal
Copy link

BRTFS -- a COW fs -- has seen improvements from io_uring 🤷 https://www.phoronix.com/news/Linux-6.1-Btrfs

@KungFuJesus
Copy link

BRTFS -- a COW fs -- has seen improvements from io_uring 🤷 https://www.phoronix.com/news/Linux-6.1-Btrfs

This was an improvement to how async io was handled when coming from io_uring rather than utilizing io_uring itself.

@ghost
Copy link

ghost commented Oct 19, 2022

OpenZFS supports io_uring, verified by the test suite: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/io/io_uring.ksh

@ghost ghost closed this as completed Oct 19, 2022
@rincebrain
Copy link
Contributor

rincebrain commented May 22, 2023

I don't...think this should be closed, unless I'm grossly misunderstanding OP's goal.

That check just confirms that fio using its io_uring engine doesn't error out. That doesn't say anything about ZFS actually leveraging this interface in any way - which it does not, as of this writing.

Feel free to close this again if I'm mistaken, but "there's a ZTS test that fio using io_uring can use OpenZFS" and "OpenZFS leverages io_uring in any way, or decides it's not useful" don't seem like the same goal.

@rincebrain rincebrain reopened this May 22, 2023
@wibed
Copy link

wibed commented Jul 27, 2023

i could imagine zvol iops and io_uring are a good match
has anyone tested this, or any experience around it?

#11407

@Harvie
Copy link
Author

Harvie commented Sep 4, 2023

https://www.phoronix.com/news/Linux-6.6-IOmap-Improvements

Does ZFS on Linux use iomap? There is some iomap improvement that leverages io_uring and memory folios to supposedly improve performance of filesystems which are using it.

https://lwn.net/Articles/935934/

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6016fc9162245c5b109305841f76cca59c20a273
https://lore.kernel.org/io-uring/20230720181310.71589-1-axboe@kernel.dk/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature Type: Performance Performance improvement or performance problem
Projects
None yet
Development

No branches or pull requests

10 participants