public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Subject: [PATCHSET for-next 0/2] Deduplicate fd-to-ctx conversions
Date: Wed,  8 Apr 2026 13:27:39 -0600	[thread overview]
Message-ID: <20260408193023.397746-1-axboe@kernel.dk> (raw)

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


             reply	other threads:[~2026-04-08 19:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 19:27 Jens Axboe [this message]
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

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=20260408193023.397746-1-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --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