public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Gabriel Krisman Bertazi <krisman@suse.de>
Cc: io-uring@vger.kernel.org
Subject: Re: [RFC v1 3/3] io_uring: introduce io_uring querying
Date: Wed, 27 Aug 2025 20:45:59 +0100	[thread overview]
Message-ID: <1a94d436-aa3d-4f15-8b98-6addee8d8595@gmail.com> (raw)
In-Reply-To: <87sehc1w0i.fsf@mailhost.krisman.be>

On 8/27/25 19:04, Gabriel Krisman Bertazi wrote:
> Pavel Begunkov <asml.silence@gmail.com> writes:
> 
>> There are many characteristics of a ring or the io_uring subsystem the
>> user wants to query. Sometimes it's needed to be done before there is a
>> created ring, and sometimes it's needed at runtime in a slow path.
>> Introduce a querying interface to achieve that.
>>
>> It was written with several requirements in mind:
>> - Can be used with or without an io_uring instance.
>> - Can query multiple attributes in one syscall.
>> - Backward and forward compatible.
>> - Should be reasobably easy to use.
>> - Reduce the kernel code size for introducing new query types.
> 
> Hello, Pavel.
> 
> Correct me if I'm wrong, or if I completely missed the point, but this
> is mostly about returning static information about what the kernel

It's primarily about configuring rings from within the application
at different steps, and it's always a huge mess when that requires
reading and parsing a text file. It's not all static either, my
main agenda here (not included) involves calculations.

> supports, which can all be calculated at compile-time.
I assume you mean kernel compilation, I can't rely on app
recompilation every time kernel changes.

> It seems it should be laid out as a procfs/sysfs /sys/kernel/io_uring
> subtree instead, making it quickly parseable with the usual coreutils
> command line tools, and then abstracted by some liburing APIs.  I don't
> see the advantage of creating a custom way for fetching kernel features
> information that only works for io_uring.
> 
> Sure, parsing sysfs is slow, but it doesn't need to be fast.  It is
> annoying, but it can be abstracted in userspace by liburing.  It is more

FWIW, I see usefulness in it not being painstakingly slow as it
might easily become with files. E.g. it can be reused to return
stats the app needs at runtime.

Funnily, it'd would create a dependency where you can't create
a ring without having another downgraded ring or using read/write
etc. syscall.

And that also won't work with fd-less ring, aka
IORING_SETUP_REGISTERED_FD_ONLY. Not sure why those are a thing,
but it wouldn't hurt to support it.

> consistent with the rest of the kernel and, for me, when tracking
> customer issues, I can trust the newly introduce files will show up in
> their supportconfig/sosreport without any extra change to these
> applications.
> 
> Then there is the part about probing a specific ring for something, and
> we have fdinfo. What information do we want to probe of a
> particular ring that is missing?  Perhaps this feature should be split from the
> general "is this feature supported" part.

The existing io_uring fdinfo is a huge mess. The format is not
great and it prints too much garbage, parsing it will be a misery.
It's not better implementation wise either, evident by the amount
of bugs it had and reversed lock nesting with trylocks.

And some queries are going to be parameterised, and there is no
good way to pass that to a file read.

-- 
Pavel Begunkov


  reply	other threads:[~2025-08-27 19:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 13:21 [RFC v1 0/3] introduce io_uring querying Pavel Begunkov
2025-08-27 13:21 ` [RFC v1 1/3] io_uring: add helper for *REGISTER_SEND_MSG_RING Pavel Begunkov
2025-08-27 13:21 ` [RFC v1 2/3] io_uring: add macro for features and valid setup flags Pavel Begunkov
2025-08-27 13:21 ` [RFC v1 3/3] io_uring: introduce io_uring querying Pavel Begunkov
2025-08-27 18:04   ` Gabriel Krisman Bertazi
2025-08-27 19:45     ` Pavel Begunkov [this message]
2025-08-27 15:35 ` [RFC v1 0/3] " Jens Axboe
2025-08-27 16:51   ` Pavel Begunkov

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 \
    --in-reply-to=1a94d436-aa3d-4f15-8b98-6addee8d8595@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    --cc=krisman@suse.de \
    /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