public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Glauber Costa <[email protected]>, [email protected]
Cc: Avi Kivity <[email protected]>
Subject: Re: [PATCH] add a helper function to verify io_uring functionality
Date: Wed, 29 Jan 2020 13:55:21 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 1/29/20 12:20 PM, Glauber Costa wrote:
> It is common for an application using an ever-evolving interface to want
> to inquire about the presence of certain functionality it plans to use.
> 
> The boilerplate to do that is about always the same: find places that
> have feature bits, match that with what we need, rinse, repeat.
> Therefore it makes sense to move this to a library function.
> 
> We have two places in which we can check for such features: the feature
> flag returned by io_uring_init_params(), and the resulting array
> returning from io_uring_probe.
> 
> I tried my best to communicate as well as possible in the function
> signature the fact that this is not supposed to test the availability
> of io_uring (which is straightforward enough), but rather a minimum set
> of requirements for usage.

I wonder if we should have a helper that returns the fully allocated
io_uring_probe struct filled out by probing the kernel. My main worry
here is that some applications will probe for various things, each of
which will setup/teardown a ring, and do the query.

Maybe it'd be enough to potentially pass in a ring?

While this patch works with a sparse command opcode field, not sure it's
the most natural way. If we do the above, maybe we can just have a
is_this_op_supported() query, since it'd be cheap if we already have the
probe struct filled out?

Outside of this discussion, some style changes are needed:

- '*' goes next to the name, struct foo *ptr, not struct foo* ptr
- Some lines over 80 chars

-- 
Jens Axboe


  reply	other threads:[~2020-01-29 20:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 19:20 [PATCH] add a helper function to verify io_uring functionality Glauber Costa
2020-01-29 20:55 ` Jens Axboe [this message]
     [not found]   ` <CAD-J=zYCvw+tBRmS42w8X6rOc9zE+L7j5jpjDL-y0YqW6KyBAw@mail.gmail.com>
2020-01-30  2:28     ` Jens Axboe
2020-01-30  4:05       ` Glauber Costa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox