io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>,
	io-uring@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] io_uring: fix reassigning work.task_pid from io-wq
Date: Tue, 11 Feb 2020 23:57:13 +0300	[thread overview]
Message-ID: <e60026f7-8e8f-7133-57e3-762a1d84269b@gmail.com> (raw)
In-Reply-To: <4a08cc5a-2100-3a31-becb-c16592905c86@kernel.dk>


[-- Attachment #1.1: Type: text/plain, Size: 848 bytes --]

On 11/02/2020 23:21, Jens Axboe wrote:
> On 2/11/20 1:01 PM, Pavel Begunkov wrote:
>> If a request got into io-wq context, io_prep_async_work() has already
>> been called. Most of the stuff there is idempotent with an exception
>> that it'll set work.task_pid to task_pid_vnr() of an io_wq worker thread
>>
>> Do only what's needed, that's io_prep_linked_timeout() and setting
>> IO_WQ_WORK_UNBOUND.
> 
> Rest of the series aside, I'm going to fix-up the pid addition to
> only set if it's zero like the others.

IMO, io_req_work_grab_env() should never be called from io-wq. It'd do nothing
good but open space for subtle bugs. And if that's enforced (as done in this
patch), it's safe to set @pid multiple times.

Probably, it worth to add the check just to not go through task_pid_vnr()
several times.

-- 
Pavel Begunkov


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-02-11 20:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 20:01 [PATCH 0/5] async punting improvements for io_uring Pavel Begunkov
2020-02-11 20:01 ` [PATCH 1/5] io_uring: remove REQ_F_MUST_PUNT Pavel Begunkov
2020-02-11 20:01 ` [PATCH 2/5] io_uring: don't call work.func from sync ctx Pavel Begunkov
2020-02-11 20:01 ` [PATCH 3/5] io_uring: fix reassigning work.task_pid from io-wq Pavel Begunkov
2020-02-11 20:21   ` Jens Axboe
2020-02-11 20:57     ` Pavel Begunkov [this message]
2020-02-11 20:59       ` Jens Axboe
2020-02-11 20:01 ` [PATCH 4/5] io_uring: add missing io_req_cancelled() Pavel Begunkov
2020-02-11 20:01 ` [PATCH 5/5] io_uring: purge req->in_async Pavel Begunkov

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=e60026f7-8e8f-7133-57e3-762a1d84269b@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).