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] tctx setup cleanups
Date: Wed,  8 Apr 2026 13:24:06 -0600	[thread overview]
Message-ID: <20260408192711.396827-1-axboe@kernel.dk> (raw)

Hi,

It's a bit annoying how io_uring_alloc_task_context() automatically
assigns tsk->io_uring, when callers later may have paths that fail.
This is fine because task cleanup deals with whatever state that
->io_uring may be in, but it would be cleaner to have it either be
assigned if it's fully setup, or not assigned at all. These 2 patches
do that by having io_uring_alloc_task_context() return the context
rather than implicitly assigning it inside the task being passed. The
caller must instead assign it to the task, when any operation that can
fail has been completed.

No functional changes intended in this series, strictly a cleanup

 io_uring/sqpoll.c |  8 ++++-
 io_uring/tctx.c   | 77 +++++++++++++++++++++++++++++------------------
 io_uring/tctx.h   |  4 +--
 3 files changed, 57 insertions(+), 32 deletions(-)

-- 
Jens Axboe


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 19:24 Jens Axboe [this message]
2026-04-08 19:24 ` [PATCH 1/2] io_uring/tctx: have io_uring_alloc_task_context() return tctx Jens Axboe
2026-04-08 19:24 ` [PATCH 2/2] io_uring/tctx: clean up __io_uring_add_tctx_node() error handling 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=20260408192711.396827-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