public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET for-next 0/2] Deduplicate fd-to-ctx conversions
@ 2026-04-08 19:27 Jens Axboe
  2026-04-08 19:27 ` [PATCH 1/2] io_uring/register: don't get a reference to the registered ring fd Jens Axboe
  2026-04-08 19:27 ` [PATCH 2/2] io_uring: unify getting ctx from passed in file descriptor Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Jens Axboe @ 2026-04-08 19:27 UTC (permalink / raw)
  To: io-uring

Hi,

io_uring_register_get_file() exists to return a file associated with
a struct io_ring_ctx, dealing with both registered ring descriptors
and with normal file descriptors. There are a few users of this, but
the main io_uring_enter(2) syscall handrolls its own.

Deduplicate that by avoiding the fget/fput for the registered ring
descriptor, as that cannot go away since it's private to the task
doing the operation. Unify how the file is put because of that, and
then we can convert io_uring_enter(2) to use this helper too and move
it closer to the hot path of the actual syscall. Then we only have a
single way of doing the ctx retrieval, rather than two separate ones.

 io_uring/bpf-ops.c  |  2 +-
 io_uring/io_uring.c | 57 ++++++++++++++++++++++++++++-----------------
 io_uring/io_uring.h |  1 +
 io_uring/register.c | 39 +++----------------------------
 io_uring/register.h |  1 -
 io_uring/rsrc.c     |  5 ++--
 6 files changed, 44 insertions(+), 61 deletions(-)

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-08 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 19:27 [PATCHSET for-next 0/2] Deduplicate fd-to-ctx conversions Jens Axboe
2026-04-08 19:27 ` [PATCH 1/2] io_uring/register: don't get a reference to the registered ring fd Jens Axboe
2026-04-08 19:27 ` [PATCH 2/2] io_uring: unify getting ctx from passed in file descriptor Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox