mbox series

[0/3] io_uring op probing fixes

Message ID 20240619020620.5301-1-krisman@suse.de (mailing list archive)
Headers show
Series io_uring op probing fixes | expand

Message

Gabriel Krisman Bertazi June 19, 2024, 2:06 a.m. UTC
Hi Jens,

I didn't know this interface existed until today, when I started looking
at creating exactly this feature.  My goal is to know which operation
supports which modes (registered buffers, bundled writes, iopoll).  Now
that I know it exists, I might just expose the extra information through
io_uring_probe_op->flags, instead of adding a new operation. What do you
think?

Anyway, this patchset is not implementing that.  Patch 1 fixes an issue
with the existing interface. Patches 2 and 3 are small cleanups to the
same path, since I was already looking at it.

I tested it with a !CONFIG_NET kernel to have some disabled operations.
It also survived the liburing testsuite.

Gabriel Krisman Bertazi (3):
  io_uring: Fix probe of disabled operations
  io_uring: Allocate only necessary memory in io_probe
  io_uring: Don't read userspace data in io_probe

 io_uring/opdef.c    |  8 ++++++++
 io_uring/opdef.h    |  4 ++--
 io_uring/register.c | 20 +++++---------------
 3 files changed, 15 insertions(+), 17 deletions(-)

Comments

Jens Axboe June 19, 2024, 1:42 p.m. UTC | #1
On 6/18/24 8:06 PM, Gabriel Krisman Bertazi wrote:
> Hi Jens,
> 
> I didn't know this interface existed until today, when I started looking
> at creating exactly this feature.  My goal is to know which operation
> supports which modes (registered buffers, bundled writes, iopoll).  Now
> that I know it exists, I might just expose the extra information through
> io_uring_probe_op->flags, instead of adding a new operation. What do you
> think?

Yes! I've always wanted to add more to the probe side, for example
which flags a given op may set in cqes as well, and what op specific
flags it takes as well. Ideally something that is then also used when
doing the prep in the op itself, as not to maintain this information
in multiple spots.
Jens Axboe June 19, 2024, 2:58 p.m. UTC | #2
On Tue, 18 Jun 2024 22:06:17 -0400, Gabriel Krisman Bertazi wrote:
> I didn't know this interface existed until today, when I started looking
> at creating exactly this feature.  My goal is to know which operation
> supports which modes (registered buffers, bundled writes, iopoll).  Now
> that I know it exists, I might just expose the extra information through
> io_uring_probe_op->flags, instead of adding a new operation. What do you
> think?
> 
> [...]

Applied, thanks!

[1/3] io_uring: Fix probe of disabled operations
      commit: 3e05b222382ec67dce7358d50b6006e91d028d8b
[2/3] io_uring: Allocate only necessary memory in io_probe
      commit: 6bc9199d0c84f5cd72922223231c7708698059a2

Best regards,