diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-04-30 14:35:17 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-05-09 06:29:06 -0600 |
commit | a4f8d94cfb7c69f996b6a52b1fcbec2f2504dd3f (patch) | |
tree | 67c453875c47912aa4bf064105ff3281363443d6 /fs/io_uring.c | |
parent | 149c69b04a901c8b611b643af8f4dd6b104e7379 (diff) | |
download | lwn-a4f8d94cfb7c69f996b6a52b1fcbec2f2504dd3f.tar.gz lwn-a4f8d94cfb7c69f996b6a52b1fcbec2f2504dd3f.zip |
io_uring: move provided and fixed buffers into the same io_kiocb area
These are mutually exclusive - if you use provided buffers, then you
cannot use fixed buffers and vice versa. Move them into the same spot
in the io_kiocb, which is also advantageous for provided buffers as
they get near the submit side hot cacheline.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 3d5a4e64d6fe..a260a0fd7b17 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -958,8 +958,14 @@ struct io_kiocb { struct task_struct *task; struct io_rsrc_node *rsrc_node; - /* store used ubuf, so we can prevent reloading */ - struct io_mapped_ubuf *imu; + + union { + /* store used ubuf, so we can prevent reloading */ + struct io_mapped_ubuf *imu; + + /* stores selected buf, valid IFF REQ_F_BUFFER_SELECTED is set */ + struct io_buffer *kbuf; + }; union { /* used by request caches, completion batching and iopoll */ @@ -976,8 +982,6 @@ struct io_kiocb { struct async_poll *apoll; /* opcode allocated if it needs to store data for async defer */ void *async_data; - /* stores selected buf, valid IFF REQ_F_BUFFER_SELECTED is set */ - struct io_buffer *kbuf; /* linked requests, IFF REQ_F_HARDLINK or REQ_F_LINK are set */ struct io_kiocb *link; /* custom credentials, valid IFF REQ_F_CREDS is set */ |