[PATCHSET v6] io_uring IO interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's v6 of the io_uring interface. Various tweaks and fixes to the
internals, especially in terms of the application facing API. See
changelog below for those.

In terms of features, the ring_fd (returned from io_uring_setup(2)) is
now pollable, so you can use poll(2)/epoll(2) and friends to get
notified of completions.

In the same ballpark, I stole the IOCB_CMD_POLL feature from aio, and
Christoph massaged it to better fit the new API. This means we now have
two new commands:

- IORING_OP_POLL_ADD. Adds an fd to poll for. A cqe will be posted to
  the CQ ring when the desired events are available.

- IORING_OP_POLL_REMOVE. Remove a previous queued POLL_ADD.

The io_uring instance is now accounted fully, and will fail if we cannot
get enough memory under the RLIMIT_MEMLOCK limit.

The liburing library has grown a few test cases, and now also the
beginnings of man pages for the project. So far we have
io_uring_register(2) documented, io_uring_setup(2) and io_uring_enter(2)
should be coming shortly, as well as a io_uring(7) man page. Thanks to
Jeff Moyer for leading this effort! Clone the liburing repo here:

git://git.kernel.dk/liburing

As usual, patches are against 5.0-rc2, and can also be found in my
io_uring branch here:

git://git.kernel.dk/linux-block io_uring


Changes since v5:
- Limit fixed buffers to UIO_MAXIOV (was USHRT_MAX)
- Limit fixed buffers to non-file backed memory (Dave Chinner)
- Fail file/buffer registration if already setup (Jeff Moyer)
- Return -ENXIO for attempt to enter dead ring
- Reorder two patches
- Cleanup some patch dependencies
- Add support for polling the ring_fd (poll(2)/epoll(2))
- Add IORING_OP_POLL_ADD/IORING_OP_POLL_REMOVE support
- Limit io_uring SQ size to 4k entries (IORING_MAX_ENTRIES)
- Check sqe->flags validity in one location, not for each opcode
- Account ring memory in RLIMIT_MEMLOCK
- Re-init completion event after io_uring_register()
- Fix SQ thread missing submission
- Fix silly use-after-free in io_free_req()


 Documentation/filesystems/vfs.txt      |    3 +
 arch/x86/entry/syscalls/syscall_32.tbl |    3 +
 arch/x86/entry/syscalls/syscall_64.tbl |    3 +
 block/bio.c                            |   59 +-
 fs/Makefile                            |    1 +
 fs/block_dev.c                         |   19 +-
 fs/file.c                              |   15 +-
 fs/file_table.c                        |    9 +-
 fs/gfs2/file.c                         |    2 +
 fs/io_uring.c                          | 2376 ++++++++++++++++++++++++
 fs/iomap.c                             |   48 +-
 fs/xfs/xfs_file.c                      |    1 +
 include/linux/bio.h                    |   14 +
 include/linux/blk_types.h              |    1 +
 include/linux/file.h                   |    2 +
 include/linux/fs.h                     |    6 +-
 include/linux/iomap.h                  |    1 +
 include/linux/sched/user.h             |    2 +-
 include/linux/syscalls.h               |    7 +
 include/uapi/linux/io_uring.h          |  141 ++
 init/Kconfig                           |    9 +
 kernel/sys_ni.c                        |    4 +
 22 files changed, 2686 insertions(+), 40 deletions(-)

-- 
Jens Axboe





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux