[GIT PULL v2] io_uring changes for 5.6-rc

From: Jens Axboe
Date: Wed Jan 29 2020 - 21:29:17 EST


Hi Linus,

Here are the io_uring changes for 5.6, once more, since Al's branch
has been merged. The delay ended up working out well on the io_uring
side, as we had a few mon/tue shuffles and a last minute fix, and I
forgot about the epoll separate branch that I hadn't pulled in yet.

So here's the pull request for this merge window. This pull request
contains:

- Support for various new opcodes (fallocate, openat, close, statx,
fadvise, madvise, openat2, non-vectored read/write, send/recv, and
epoll_ctl)

- Faster ring quiesce for fileset updates

- Optimizations for overflow condition checking

- Support for max-sized clamping

- Support for probing what opcodes are supported

- Support for io-wq backend sharing between "sibling" rings

- Support for registering personalities

- Lots of little fixes and improvements

The pull will throw a small merge conflict, due to the last minute
revert we had before 5.5. Trivial to resolve, attaching my resolution
just for reference.

Please pull!


git://git.kernel.dk/linux-block.git tags/for-5.6/io_uring-vfs-2020-01-29


----------------------------------------------------------------
Jens Axboe (45):
Merge branch 'work.openat2' of git://git.kernel.org/.../viro/vfs into for-5.6/io_uring-vfs
Merge branch 'io_uring-5.5' into for-5.6/io_uring-vfs
io_uring: add support for fallocate()
fs: make build_open_flags() available internally
io_uring: add support for IORING_OP_OPENAT
fs: move filp_close() outside of __close_fd_get_file()
io-wq: add support for uncancellable work
io_uring: add support for IORING_OP_CLOSE
io_uring: avoid ring quiesce for fixed file set unregister and update
fs: make two stat prep helpers available
io_uring: add support for IORING_OP_STATX
io-wq: support concurrent non-blocking work
io_uring: add IOSQE_ASYNC
io_uring: remove two unnecessary function declarations
io_uring: add lookup table for various opcode needs
io_uring: split overflow state into SQ and CQ side
io_uring: improve poll completion performance
io_uring: add non-vectored read/write commands
io_uring: allow use of offset == -1 to mean file position
io_uring: add IORING_OP_FADVISE
mm: make do_madvise() available internally
io_uring: add IORING_OP_MADVISE
io_uring: wrap multi-req freeing in struct req_batch
io_uring: extend batch freeing to cover more cases
io_uring: add support for IORING_SETUP_CLAMP
io_uring: add support for send(2) and recv(2)
io_uring: file set registration should use interruptible waits
io_uring: change io_ring_ctx bool fields into bit fields
io_uring: enable option to only trigger eventfd for async completions
io_uring: add 'struct open_how' to the openat request context
io_uring: remove 'fname' from io_open structure
io_uring: add support for IORING_OP_OPENAT2
io_uring: add opcode to issue trace event
io_uring: account fixed file references correctly in batch
io_uring: add support for probing opcodes
io_uring: file switch work needs to get flushed on exit
io_uring: don't attempt to copy iovec for READ/WRITE
io-wq: make the io_wq ref counted
io_uring/io-wq: don't use static creds/mm assignments
io_uring: allow registering credentials
io_uring: support using a registered personality for commands
io_uring: fix linked command file table usage
eventpoll: abstract out epoll_ctl() handler
eventpoll: support non-blocking do_epoll_ctl() calls
io_uring: add support for epoll_ctl(2)

Pavel Begunkov (20):
io_uring: rename prev to head
io_uring: move *queue_link_head() from common path
pcpu_ref: add percpu_ref_tryget_many()
io_uring: batch getting pcpu references
io_uring: clamp to_submit in io_submit_sqes()
io_uring: optimise head checks in io_get_sqring()
io_uring: optimise commit_sqring() for common case
io_uring: remove extra io_wq_current_is_worker()
io_uring: optimise use of ctx->drain_next
io_uring: remove extra check in __io_commit_cqring
io_uring: hide uring_fd in ctx
io_uring: remove REQ_F_IO_DRAINED
io_uring: optimise sqe-to-req flags translation
io_uring: use labeled array init in io_op_defs
io_uring: prep req when do IOSQE_ASYNC
io_uring: honor IOSQE_ASYNC for linked reqs
io_uring: add comment for drain_next
io_uring: fix refcounting with batched allocations at OOM
io-wq: allow grabbing existing io-wq
io_uring: add io-wq workqueue sharing

YueHaibing (1):
io_uring: Remove unnecessary null check

drivers/android/binder.c | 6 +-
fs/eventpoll.c | 87 +-
fs/file.c | 6 +-
fs/internal.h | 8 +
fs/io-wq.c | 103 +-
fs/io-wq.h | 11 +-
fs/io_uring.c | 2412 +++++++++++++++++++++++++++++++--------
fs/open.c | 5 +-
fs/stat.c | 34 +-
include/linux/eventpoll.h | 9 +
include/linux/mm.h | 1 +
include/linux/percpu-refcount.h | 26 +-
include/trace/events/io_uring.h | 13 +-
include/uapi/linux/io_uring.h | 73 +-
mm/madvise.c | 7 +-
15 files changed, 2218 insertions(+), 583 deletions(-)

--
Jens Axboe




commit 9d8bd6fcf0ebfccf39e6ac44df3c41155481030e
Merge: c0007c4f36a7 61cd83d3ade6
Author: Jens Axboe <axboe@xxxxxxxxx>
Date: Mon Jan 27 12:50:20 2020 -0700

Merge branch 'for-5.6/io_uring-vfs' into ll

* for-5.6/io_uring-vfs: (58 commits)
io_uring: fix refcounting with batched allocations at OOM
io_uring: add comment for drain_next
io_uring: don't attempt to copy iovec for READ/WRITE
io_uring: add support for sharing kernel io-wq workqueue
io-wq: allow lookup of existing io_wq with given id
io-wq: add 'id' to io_wq
io-wq: make the io_wq ref counted
io_uring: honor IOSQE_ASYNC for linked reqs
io_uring: prep req when do IOSQE_ASYNC
io_uring: use labeled array init in io_op_defs
io_uring: optimise sqe-to-req flags translation
io_uring: remove REQ_F_IO_DRAINED
io_uring: file switch work needs to get flushed on exit
io_uring: hide uring_fd in ctx
io_uring: remove extra check in __io_commit_cqring
io_uring: optimise use of ctx->drain_next
io_uring: add support for probing opcodes
io_uring: account fixed file references correctly in batch
io_uring: add opcode to issue trace event
io_uring: add support for IORING_OP_OPENAT2
...

Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>

diff --cc fs/io_uring.c
index e54556b0fcc6,65fe16a795c1..eeaafbd74259
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@@ -5157,7 -6312,12 +6308,6 @@@ SYSCALL_DEFINE6(io_uring_enter, unsigne
} else if (to_submit) {
struct mm_struct *cur_mm;

- to_submit = min(to_submit, ctx->sq_entries);
- if (current->mm != ctx->sqo_mm ||
- current_cred() != ctx->creds) {
- ret = -EPERM;
- goto out;
- }
-
mutex_lock(&ctx->uring_lock);
/* already have mm, so io_submit_sqes() won't try to grab it */
cur_mm = ctx->sqo_mm;