From: Caleb Sander Mateos <csander@purestorage.com>
To: Pavel Begunkov <asml.silence@gmail.com>
Cc: io-uring@vger.kernel.org, bpf@vger.kernel.org, axboe@kernel.dk,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subject: Re: [PATCH v10 0/4] BPF controlled io_uring
Date: Mon, 9 Mar 2026 08:02:28 -0700 [thread overview]
Message-ID: <CADUfDZoBTwnCo-f_st9-jdgNhHLWUCjZQFpGdowGUA5BoJ836w@mail.gmail.com> (raw)
In-Reply-To: <d8c8748a-4b13-4097-bdeb-495e6410a0df@gmail.com>
On Mon, Mar 9, 2026 at 6:24 AM Pavel Begunkov <asml.silence@gmail.com> wrote:
>
> On 2/26/26 12:48, Pavel Begunkov wrote:
> > Introduces a way to override the standard io_uring_enter syscall
> > execution with an extendible event loop, which can be controlled
> > by BPF via new io_uring struct_ops or from within the kernel.
> >
> > There are multiple use cases I want to cover with this:
> >
> > - Syscall avoidance. Instead of returning to the userspace for
> > CQE processing, a part of the logic can be moved into BPF to
> > avoid excessive number of syscalls.
> >
> > - Access to in-kernel io_uring resources. For example, there are
> > registered buffers that can't be directly accessed by the userspace,
> > however we can give BPF the ability to peek at them. It can be used
> > to take a look at in-buffer app level headers to decide what to do
> > with data next and issuing IO using it.
> >
> > - Smarter request ordering and linking. Request links are pretty
> > limited and inflexible as they can't pass information from one
> > request to another. With BPF we can peek at CQEs and memory and
> > compile a subsequent request.
> >
> > - Feature semi-deprecation. It can be used to simplify handling
> > of deprecated features by moving it into the callback out core
> > io_uring. For example, it should be trivial to simulate
> > IOSQE_IO_DRAIN. Another target could be request linking logic.
> >
> > - It can serve as a base for custom algorithms and fine tuning.
> > Often, it'd be impractical to introduce a generic feature because
> > it's either niche or requires a lot of configuration. For example,
> > there is support min-wait, however BPF can help to further fine tune
> > it by doing it in multiple steps with different number of CQEs /
> > timeouts. Another feature people were asking about is allowing
> > to over queue SQEs but make the kernel to maintain a given QD.
> >
> > - Smarter polling. Napi polling is performed only once per syscall
> > and then it switches to waiting. We can do smarter and intermix
> > polling with waiting using the hook.
>
> Any comments for the patch set?
I'm not opposed to this feature, but I agree with Ming that it seems
largely orthogonal to his patchset allowing BPF programs to access
io_uring registered buffers[1]. This patchset doesn't provide any
kfuncs for interacting with registered buffers, so we would still need
something like the kfuncs implemented by Ming's patchset to allow BPF
programs to access registered buffers directly. Although either the
->loop_step() or ->prep()/->issue() interface could allow userspace to
run a BPF program in the context of the io_uring, I wouldn't be keen
on reimplementing the entire io_uring_enter() loop logic just to
intercept a few requests to run BPF programs. The ->prep()/->issue()
abstraction seems more straightforward to me, though I understand that
it's not as general as the ability to modify the behavior of the
entire io_uring_enter() syscall.
Best,
Caleb
[1]: https://lore.kernel.org/io-uring/20260106101126.4064990-1-ming.lei@redhat.com/T/#u
prev parent reply other threads:[~2026-03-09 15:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 12:48 [PATCH v10 0/4] BPF controlled io_uring Pavel Begunkov
2026-02-26 12:48 ` [PATCH v10 1/4] io_uring: introduce callback driven main loop Pavel Begunkov
2026-02-26 12:48 ` [PATCH v10 2/4] io_uring/bpf-ops: implement loop_step with BPF struct_ops Pavel Begunkov
2026-02-26 12:48 ` [PATCH v10 3/4] io_uring/bpf-ops: add kfunc helpers Pavel Begunkov
2026-02-26 12:48 ` [PATCH v10 4/4] io_uring/bpf-ops: implement bpf ops registration Pavel Begunkov
2026-03-09 13:24 ` [PATCH v10 0/4] BPF controlled io_uring Pavel Begunkov
2026-03-09 15:02 ` Caleb Sander Mateos [this message]
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=CADUfDZoBTwnCo-f_st9-jdgNhHLWUCjZQFpGdowGUA5BoJ836w@mail.gmail.com \
--to=csander@purestorage.com \
--cc=alexei.starovoitov@gmail.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=bpf@vger.kernel.org \
--cc=io-uring@vger.kernel.org \
/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