All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org,
	linux-block@vger.kernel.org
Cc: hch@lst.de, jmoyer@redhat.com, avi@scylladb.com
Subject: [PATCHSET v6] io_uring IO interface
Date: Fri, 18 Jan 2019 09:12:08 -0700	[thread overview]
Message-ID: <20190118161225.4545-1-axboe@kernel.dk> (raw)

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



             reply	other threads:[~2019-01-18 16:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 16:12 Jens Axboe [this message]
2019-01-18 16:12 ` [PATCH 01/17] fs: add an iopoll method to struct file_operations Jens Axboe
2019-01-18 16:12 ` [PATCH 02/17] block: wire up block device iopoll method Jens Axboe
2019-01-18 16:12 ` [PATCH 03/17] block: add bio_set_polled() helper Jens Axboe
2019-01-18 16:12 ` [PATCH 04/17] iomap: wire up the iopoll method Jens Axboe
2019-01-18 16:12 ` [PATCH 05/17] Add io_uring IO interface Jens Axboe
2019-01-21  9:13   ` Roman Penyaev
2019-01-21 15:30     ` Jens Axboe
2019-01-21 15:58       ` Roman Penyaev
2019-01-21 16:23         ` Jens Axboe
2019-01-21 16:49           ` Roman Penyaev
2019-01-22 16:11             ` Jens Axboe
2019-01-18 16:12 ` [PATCH 06/17] io_uring: add fsync support Jens Axboe
2019-01-18 16:12 ` [PATCH 07/17] io_uring: support for IO polling Jens Axboe
2019-01-18 16:12 ` [PATCH 08/17] fs: add fget_many() and fput_many() Jens Axboe
2019-01-18 16:12 ` [PATCH 09/17] io_uring: use fget/fput_many() for file references Jens Axboe
2019-01-18 16:12 ` [PATCH 10/17] io_uring: batch io_kiocb allocation Jens Axboe
2019-01-18 16:12 ` [PATCH 11/17] block: implement bio helper to add iter bvec pages to bio Jens Axboe
2019-01-18 16:12 ` [PATCH 12/17] io_uring: add support for pre-mapped user IO buffers Jens Axboe
2019-01-18 16:12 ` [PATCH 13/17] io_uring: add file set registration Jens Axboe
2019-01-18 16:12 ` [PATCH 14/17] io_uring: add submission polling Jens Axboe
2019-01-18 16:12 ` [PATCH 15/17] io_uring: add io_kiocb ref count Jens Axboe
2019-01-18 16:12 ` [PATCH 16/17] io_uring: add support for IORING_OP_POLL Jens Axboe
2019-01-18 16:12 ` [PATCH 17/17] io_uring: add io_uring_event cache hit information Jens Axboe

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=20190118161225.4545-1-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=avi@scylladb.com \
    --cc=hch@lst.de \
    --cc=jmoyer@redhat.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.