IO-Uring Archive on
 help / color / Atom feed
From: Pavel Begunkov <>
To: Jens Axboe <>,,
Subject: Re: [PATCH 3/5] io_uring: fix reassigning work.task_pid from io-wq
Date: Tue, 11 Feb 2020 23:57:13 +0300
Message-ID: <> (raw)
In-Reply-To: <>

[-- 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
> 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 index

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

IO-Uring Archive on

Archives are clonable:
	git clone --mirror io-uring/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 io-uring io-uring/ \
	public-inbox-index io-uring

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone