All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: Re: [PATCH 3/3] io_uring: move struct io_kiocb from task_struct to io_uring_task
Date: Mon, 4 Nov 2024 16:43:43 +0000	[thread overview]
Message-ID: <15accb24-3edf-40de-bbec-94f8d146d01d@gmail.com> (raw)
In-Reply-To: <8e84b4ee-e94f-4b78-bb94-89ea2ad00996@kernel.dk>

On 11/4/24 16:16, Jens Axboe wrote:
> On 11/4/24 8:41 AM, Pavel Begunkov wrote:
>> On 11/3/24 17:49, Jens Axboe wrote:
>>> Rather than store the task_struct itself in struct io_kiocb, store
>>> the io_uring specific task_struct. The life times are the same in terms
>>> of io_uring, and this avoids doing some dereferences through the
>>> task_struct. For the hot path of putting local task references, we can
>>
>> Makes me wonder, is __io_submit_flush_completions() the only hot
>> place it tries to improve? It doesn't have to look into the task
>> there but on the other hand we need to do it that init.
>> If that's costly, for DEFER_TASKRUN we can get rid of per task
>> counting, the task is pinned together with the ctx, and the task
>> exit path can count the number of requests allocated.
>>
>> if (!(ctx->flags & DEFER_TASKRUN))
>>      io_task_get_ref();
>>
>> if (!(ctx->flags & DEFER_TASKRUN))
>>      io_task_put_ref();
>>
>> But can be further improved
> 
> Avoid task refs would surely be useful. For SINGLE_ISSUER, no?

Perhaps, but it doesn't imply single waiter / completer task.
IOPOLL would need to be checked and possibly there might be
races with io-wq. In general, all optimisations just got
shifted into DEFER_TASKRUN and SINGLE_ISSUER is not that useful
apart from carrying the semantics.

-- 
Pavel Begunkov

      reply	other threads:[~2024-11-04 16:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-03 17:49 [PATCHSET 0/3] Move io_kiocb from task_struct to io_uring_task Jens Axboe
2024-11-03 17:49 ` [PATCH 1/3] io_uring: move cancelations to be io_uring_task based Jens Axboe
2024-11-03 17:49 ` [PATCH 2/3] io_uring: remove task ref helpers Jens Axboe
2024-11-03 17:49 ` [PATCH 3/3] io_uring: move struct io_kiocb from task_struct to io_uring_task Jens Axboe
2024-11-03 21:47   ` Pavel Begunkov
2024-11-03 21:54     ` Jens Axboe
2024-11-03 22:05       ` Pavel Begunkov
2024-11-03 22:18         ` Jens Axboe
2024-11-03 22:36           ` Pavel Begunkov
2024-11-03 22:40             ` Jens Axboe
2024-11-03 22:47               ` Pavel Begunkov
2024-11-03 22:51                 ` Jens Axboe
2024-11-03 23:17                   ` Pavel Begunkov
2024-11-03 23:25                     ` Jens Axboe
2024-11-04 15:41   ` Pavel Begunkov
2024-11-04 16:16     ` Jens Axboe
2024-11-04 16:43       ` Pavel Begunkov [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=15accb24-3edf-40de-bbec-94f8d146d01d@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=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 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.