public inbox for [email protected]
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <[email protected]>
To: Pavel Begunkov <[email protected]>
Cc: [email protected], Jens Axboe <[email protected]>
Subject: Re: [PATCH] io_uring: kill tw-related outdated comments
Date: Thu, 17 Nov 2022 14:45:04 -0500	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <deb4db0984b07e026d08b7bd1886cfc120d67f17.1668710788.git.asml.silence@gmail.com> (Pavel Begunkov's message of "Thu, 17 Nov 2022 18:47:04 +0000")

Pavel Begunkov <[email protected]> writes:

> task_work fallback is executed from a workqueue, so current and
> req->task are not necessarily the same. It's still safe to poke into it
> as the request holds a task_struct reference.

Makes sense to me.  Feel free to add

Reviewed-by: Gabriel Krisman Bertazi <[email protected]>

>
> Signed-off-by: Pavel Begunkov <[email protected]>
> ---
>  io_uring/io_uring.c | 2 +-
>  io_uring/poll.c     | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
> index 94329c1ce91d..5a8a43fb6750 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -1249,7 +1249,7 @@ static void io_req_task_cancel(struct io_kiocb *req, bool *locked)
>  void io_req_task_submit(struct io_kiocb *req, bool *locked)
>  {
>  	io_tw_lock(req->ctx, locked);
> -	/* req->task == current here, checking PF_EXITING is safe */
> +
>  	if (likely(!(req->task->flags & PF_EXITING)))
>  		io_queue_sqe(req);
>  	else
> diff --git a/io_uring/poll.c b/io_uring/poll.c
> index 2830b7daf952..5d4a0a4a379a 100644
> --- a/io_uring/poll.c
> +++ b/io_uring/poll.c
> @@ -214,7 +214,6 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked)
>  	struct io_ring_ctx *ctx = req->ctx;
>  	int v, ret;
>  
> -	/* req->task == current here, checking PF_EXITING is safe */
>  	if (unlikely(req->task->flags & PF_EXITING))
>  		return -ECANCELED;

-- 
Gabriel Krisman Bertazi

      reply	other threads:[~2022-11-17 19:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 18:47 [PATCH] io_uring: kill tw-related outdated comments Pavel Begunkov
2022-11-17 19:45 ` Gabriel Krisman Bertazi [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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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