Commit Graph

10 Commits

Author SHA1 Message Date
Jeff Moyer ed486f925a io_uring: Fix probe of disabled operations
JIRA: https://issues.redhat.com/browse/RHEL-64867

commit 3e05b222382ec67dce7358d50b6006e91d028d8b
Author: Gabriel Krisman Bertazi <krisman@suse.de>
Date:   Tue Jun 18 22:06:18 2024 -0400

    io_uring: Fix probe of disabled operations
    
    io_probe checks io_issue_def->not_supported, but we never really set
    that field, as we mark non-supported functions through a specific ->prep
    handler.  This means we end up returning IO_URING_OP_SUPPORTED, even for
    disabled operations.  Fix it by just checking the prep handler itself.
    
    Fixes: 66f4af93da ("io_uring: add support for probing opcodes")
    Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
    Link: https://lore.kernel.org/r/20240619020620.5301-2-krisman@suse.de
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2024-12-02 11:21:29 -05:00
Jeff Moyer 5541c9a578 io_uring: drop ->prep_async()
JIRA: https://issues.redhat.com/browse/RHEL-64867

commit e10677a8f6980dbae2e866b8320d90bae07e87ee
Author: Jens Axboe <axboe@kernel.dk>
Date:   Mon Mar 18 20:48:38 2024 -0600

    io_uring: drop ->prep_async()
    
    It's now unused, drop the code related to it. This includes the
    io_issue_defs->manual alloc field.
    
    While in there, and since ->async_size is now being used a bit more
    frequently and in the issue path, move it to io_issue_defs[].
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2024-11-28 16:55:44 -05:00
Jeff Moyer 11796f3222 io_uring/rw: mark readv/writev as vectored in the opcode definition
JIRA: https://issues.redhat.com/browse/RHEL-27755

commit d2d778fbf9964e4e5b8d7420eba8ec5ce938e794
Author: Jens Axboe <axboe@kernel.dk>
Date:   Mon Sep 11 13:46:07 2023 -0600

    io_uring/rw: mark readv/writev as vectored in the opcode definition
    
    This is cleaner than gating on the opcode type, particularly as more
    read/write type opcodes may be added.
    
    Then we can use that for the data import, and for __io_read() on
    whether or not we need to copy state.
    
    Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2024-07-02 09:41:34 -04:00
Jeff Moyer 0ed86416ea io_uring: Split io_issue_def struct
JIRA: https://issues.redhat.com/browse/RHEL-12076
Conflicts: Minor conflicts due to having applied patches out of order.

commit f30bd4d03824fb437bf080c2b2f926cfee3f09d0
Author: Breno Leitao <leitao@debian.org>
Date:   Thu Jan 12 06:44:11 2023 -0800

    io_uring: Split io_issue_def struct
    
    This patch removes some "cold" fields from `struct io_issue_def`.
    
    The plan is to keep only highly used fields into `struct io_issue_def`, so,
    it may be hot in the cache. The hot fields are basically all the bitfields
    and the callback functions for .issue and .prep.
    
    The other less frequently used fields are now located in a secondary and
    cold struct, called `io_cold_def`.
    
    This is the size for the structs:
    
    Before: io_issue_def = 56 bytes
    After: io_issue_def = 24 bytes; io_cold_def = 40 bytes
    
    Signed-off-by: Breno Leitao <leitao@debian.org>
    Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/20230112144411.2624698-2-leitao@debian.org
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-11-02 15:31:09 -04:00
Jeff Moyer 0c3b521dde io_uring: Rename struct io_op_def
JIRA: https://issues.redhat.com/browse/RHEL-12076

commit a7dd27828b00be8c0c7520c53baf0b360f4d8bea
Author: Breno Leitao <leitao@debian.org>
Date:   Thu Jan 12 06:44:10 2023 -0800

    io_uring: Rename struct io_op_def
    
    The current io_op_def struct is becoming huge and the name is a bit
    generic.
    
    The goal of this patch is to rename this struct to `io_issue_def`. This
    struct will contain the hot functions associated with the issue code
    path.
    
    For now, this patch only renames the structure, and an upcoming patch
    will break up the structure in two, moving the non-issue fields to a
    secondary struct.
    
    Signed-off-by: Breno Leitao <leitao@debian.org>
    Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/20230112144411.2624698-1-leitao@debian.org
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-11-02 15:31:09 -04:00
Jeff Moyer ac9e612458 io_uring: dont remove file from msg_ring reqs
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit ef0ec1ad03119b8b46b035dad42bca7d6da7c2e5
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Wed Dec 7 03:53:26 2022 +0000

    io_uring: dont remove file from msg_ring reqs
    
    We should not be messing with req->file outside of core paths. Clearing
    it makes msg_ring non reentrant, i.e. luckily io_msg_send_fd() fails the
    request on failed io_double_lock_ctx() but clearly was originally
    intended to do retries instead.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/e5ac9edadb574fe33f6d727cb8f14ce68262a684.1670384893.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-05-05 15:25:18 -04:00
Jeff Moyer 482097577e io_uring: add custom opcode hooks on fail
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit a47b255e90395bdb481975ab3d9e96fcf8b3165f
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Wed Sep 21 12:17:46 2022 +0100

    io_uring: add custom opcode hooks on fail
    
    Sometimes we have to do a little bit of a fixup on a request failuer in
    io_req_complete_failed(). Add a callback in opdef for that.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/b734cff4e67cb30cca976b9face321023f37549a.1663668091.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-05-05 15:23:55 -04:00
Jeff Moyer 7f0ee8c445 io_uring: conditional ->async_data allocation
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit 5916943943d19a854238d50d1fe2047467cbeb3c
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Wed Aug 24 13:07:42 2022 +0100

    io_uring: conditional ->async_data allocation
    
    There are opcodes that need ->async_data only in some cases and
    allocation it unconditionally may hurt performance. Add an option to
    opdef to make move the allocation part from the core io_uring to opcode
    specific code.
    Note, we can't just set opdef->async_size to zero because there are
    other helpers that rely on it, e.g. io_alloc_async_data().
    
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/9dc62be9e88dd0ed63c48365340e8922d2498293.1661342812.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-05-05 15:22:55 -04:00
Jeff Moyer 8b23020e0d io_uring: move opcode table to opdef.c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit d9b57aa3cfc792ccac6858376c017dbea6cb2872
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed Jun 15 16:27:42 2022 -0600

    io_uring: move opcode table to opdef.c
    
    We already have the declarations in opdef.h, move the rest into its own
    file rather than in the main io_uring.c file.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 05:42:02 -04:00
Jeff Moyer 8b159d94cc io_uring: move poll handling into its own file
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit 329061d3e2f9a0082a097e9558bd5497098586c6
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed May 25 20:31:09 2022 -0600

    io_uring: move poll handling into its own file
    
    Add a io_poll_issue() rather than export the general task_work locking
    and io_issue_sqe(), and put the io_op_defs definition and structure into
    a separate header file so that poll can use it.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 05:36:02 -04:00