All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, Dylan Yudaken <dylany@fb.com>
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-team@fb.com
Subject: Re: [PATCH v2 1/3] io_uring: register single issuer task at creation
Date: Mon, 26 Sep 2022 21:29:32 +0100	[thread overview]
Message-ID: <3a582199-7ee6-caf7-0314-a8a32a17b980@gmail.com> (raw)
In-Reply-To: <4623be74-d877-9042-f876-09feba2f0587@kernel.dk>

On 9/26/22 20:40, Jens Axboe wrote:
> On 9/26/22 1:12 PM, Pavel Begunkov wrote:
>> On 9/26/22 18:09, Dylan Yudaken wrote:
>>> Instead of picking the task from the first submitter task, rather use the
>>> creator task or in the case of disabled (IORING_SETUP_R_DISABLED) the
>>> enabling task.
>>>
>>> This approach allows a lot of simplification of the logic here. This
>>> removes init logic from the submission path, which can always be a bit
>>> confusing, but also removes the need for locking to write (or read) the
>>> submitter_task.
>>>
>>> Users that want to move a ring before submitting can create the ring
>>> disabled and then enable it on the submitting task.
>>
>> I think Dylan briefly mentioned before that it might be a good
>> idea to task limit registration as well. I can't think of a use
>> case at the moment but I agree we may find some in the future.
>>
>>
>> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
>> index 242d896c00f3..60a471e43fd9 100644
>> --- a/io_uring/io_uring.c
>> +++ b/io_uring/io_uring.c
>> @@ -3706,6 +3706,9 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
>>       if (WARN_ON_ONCE(percpu_ref_is_dying(&ctx->refs)))
>>           return -ENXIO;
>>   
>> +    if (ctx->submitter_task && ctx->submitter_task != current)
>> +        return -EEXIST;
>> +
>>       if (ctx->restricted) {
>>           if (opcode >= IORING_REGISTER_LAST)
>>               return -EINVAL;
> 
> Yes, I don't see any reason why not to enforce this for registration
> too. Don't think there's currently a need to do so, but it'd be easy
> to miss once we do add that. Let's queue that up for 6.1?

6.1 + stable sounds ok, I don't have an opinion on how to how
to merge it.

-- 
Pavel Begunkov

  reply	other threads:[~2022-09-26 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26 17:09 [PATCH v2 0/3] io_uring: register single issuer task at creation Dylan Yudaken
2022-09-26 17:09 ` [PATCH v2 1/3] " Dylan Yudaken
2022-09-26 19:12   ` Pavel Begunkov
2022-09-26 19:40     ` Jens Axboe
2022-09-26 20:29       ` Pavel Begunkov [this message]
2022-09-26 20:58         ` Jens Axboe
2022-09-26 17:09 ` [PATCH v2 2/3] io_uring: simplify __io_uring_add_tctx_node Dylan Yudaken
2022-09-26 17:09 ` [PATCH v2 3/3] io_uring: remove io_register_submitter Dylan Yudaken
2022-09-26 17:30 ` [PATCH v2 0/3] io_uring: register single issuer task at creation 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=3a582199-7ee6-caf7-0314-a8a32a17b980@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=dylany@fb.com \
    --cc=io-uring@vger.kernel.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.