Skip to contentSkip to conversation

io_uring fixes for 5.6-rc2

GIT PULL Merged Jens Axboe 3 participants 4 messages Feb 14, 2020 – Feb 15, 2020 io_uring

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

Hi Linus,

Here's a set of fixes for io_uring that should go into this release. This pull request contains:

- Various fixes with cleanups from Pavel, fixing corner cases where we're not correctly dealing with iovec cleanup.

- Clarify that statx/openat/openat2 don't accept fixed files

- Buffered raw device write EOPTNOTSUPP fix

- Ensure async workers grab current->fs

- A few task exit fixes with pending requests that grab the file table

- send/recvmsg async load fix

- io-wq offline node setup fix

- CQ overflow flush in poll

Please pull!

git://git.kernel.dk/linux-block.git tags/io_uring-5.6-2020-02-14

----------------------------------------------------------------
Jens Axboe (11):
io_uring: statx/openat/openat2 don't support fixed files
io_uring: retry raw bdev writes if we hit -EOPNOTSUPP
io-wq: add support for inheriting ->fs
io_uring: grab ->fs as part of async preparation
io_uring: allow AT_FDCWD for non-file openat/openat2/statx
io-wq: make io_wqe_cancel_work() take a match handler
io-wq: add io_wq_cancel_pid() to cancel based on a specific pid
io_uring: cancel pending async work if task exits
io_uring: retain sockaddr_storage across send/recvmsg async punt
io-wq: don't call kXalloc_node() with non-online node
io_uring: prune request from overflow list on flush

Pavel Begunkov (8):
io_uring: get rid of delayed mm check
io_uring: fix deferred req iovec leak
io_uring: remove unused struct io_async_open
io_uring: fix iovec leaks
io_uring: add cleanup for openat()/statx()
io_uring: fix async close() with f_op->flush()
io_uring: fix double prep iovec leak
io_uring: fix openat/statx's filename leak

Randy Dunlap (1):
io_uring: fix 1-bit bitfields to be unsigned

Stefano Garzarella (1):
io_uring: flush overflowed CQ events in the io_uring_poll()

 fs/io-wq.c    |  92 +++++++++++++++---
 fs/io-wq.h    |   6 +-
 fs/io_uring.c | 299 +++++++++++++++++++++++++++++++++++++++-------------------
 3 files changed, 284 insertions(+), 113 deletions(-)
Signature · 1 line
Jens Axboe
#1 lore raw
Quoted 2 lines · Jens Axboe

Here's a set of fixes for io_uring that should go into this release.

Whaa?

          for_each_node(node) {

+ if (!node_online(node))
+ continue;

that's just silly.

We have 'for_each_online_node()' for this.

There's something like four patterns of that pointless thing.

And in io_wq_create(), do you really want to allocate that wqe for nodes that aren't online? Right now you _allocate_ the node data for them (using a non-node-specific allocation), but then you won't actually create the thread for them io_wq_manager().

Plus if the node online status changes, it looks like you'll mess up _anyway_, in that io_wq_manager() will first create the workers on one set of nodes, but then perhaps set the state flags for a completely different set of nodes if some onlining/offlining has happened.

I've pulled this, but Jens, you need to be more careful. This all looks like completely random state that nobody spent any time thinking about.

Seriously, this "io_uring FIXES ONLY" needs to be stricter than what you seem to be doing here. This "fix" is opening up a lot of new possibilities for inconsistencies in the data structures.

Linus

author maintainer
#2 lore raw
Quoted 10 lines · Linus Torvalds
Quoted 2 lines · Jens Axboe

Here's a set of fixes for io_uring that should go into this release.

Whaa?

          for_each_node(node) {
(quoted diff) +2 -0
+                if (!node_online(node))
+                        continue;
Quoted 5 lines

that's just silly.

We have 'for_each_online_node()' for this.

There's something like four patterns of that pointless thing.

Sorry, that definitely should have been for_each_online_node() for those, guess I didn't think of that when making the change.

Quoted 4 lines

And in io_wq_create(), do you really want to allocate that wqe for nodes that aren't online? Right now you _allocate_ the node data for them (using a non-node-specific allocation), but then you won't actually create the thread for them io_wq_manager().

I was thinking about this a bit, and as far as I know there's no good way to get notified of nodes coming and going. And I'd really like to avoid having to add that to the fast path.

So this seemed like the lesser of evils, we setup the wqe just in case the node does come online, and then rely on the manager creating the thread when we need it. Not sure what setup was run to create it, I haven't come across any boxes where we have nodes that are present but not online.

Quoted 5 lines

Plus if the node online status changes, it looks like you'll mess up _anyway_, in that io_wq_manager() will first create the workers on one set of nodes, but then perhaps set the state flags for a completely different set of nodes if some onlining/offlining has happened.

We'll look into making this more clear and bullet proof.

Quoted 7 lines

I've pulled this, but Jens, you need to be more careful. This all looks like completely random state that nobody spent any time thinking about.

Seriously, this "io_uring FIXES ONLY" needs to be stricter than what you seem to be doing here. This "fix" is opening up a lot of new possibilities for inconsistencies in the data structures.

We'll get it sorted for 5.6. Thanks for pulling.

Signature · 1 line
Jens Axboe
merge bot Merged
#3 lore raw
In reply to Jens Axboe
The pull request you sent on Fri, 14 Feb 2020 09:45:26 -0700:

The pull request you sent on Fri, 14 Feb 2020 09:45:26 -0700:

Quoted 1 line

git://git.kernel.dk/linux-block.git tags/io_uring-5.6-2020-02-14

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/ca60ad6a6bc4aa88c02c6f103dd80df54689ea4d

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker