All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Caleb Sander Mateos <csander@purestorage.com>
Cc: Uday Shankar <ushankar@purestorage.com>,
	io-uring@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring/io-wq: always retry worker create on ERESTART*
Date: Wed, 03 Dec 2025 07:53:11 -0700	[thread overview]
Message-ID: <176477359158.834078.5263900730628607784.b4-ty@kernel.dk> (raw)
In-Reply-To: <20251202205745.3709469-1-csander@purestorage.com>


On Tue, 02 Dec 2025 13:57:44 -0700, Caleb Sander Mateos wrote:
> If a task has a pending signal when create_io_thread() is called,
> copy_process() will return -ERESTARTNOINTR. io_should_retry_thread()
> will request a retry of create_io_thread() up to WORKER_INIT_LIMIT = 3
> times. If all retries fail, the io_uring request will fail with
> ECANCELED.
> Commit 3918315c5dc ("io-wq: backoff when retrying worker creation")
> added a linear backoff to allow the thread to handle its signal before
> the retry. However, a thread receiving frequent signals may get unlucky
> and have a signal pending at every retry. Since the userspace task
> doesn't control when it receives signals, there's no easy way for it to
> prevent the create_io_thread() failure due to pending signals. The task
> may also lack the information necessary to regenerate the canceled SQE.
> So always retry the create_io_thread() on the ERESTART* errors,
> analogous to what a fork() syscall would do. EAGAIN can occur due to
> various persistent conditions such as exceeding RLIMIT_NPROC, so respect
> the WORKER_INIT_LIMIT retry limit for EAGAIN errors.
> 
> [...]

Applied, thanks!

[1/1] io_uring/io-wq: always retry worker create on ERESTART*
      commit: 777dfd696d3db9b7b08a41c3c03554ce0ba6c94e

Best regards,
-- 
Jens Axboe




      reply	other threads:[~2025-12-03 14:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 20:57 [PATCH] io_uring/io-wq: always retry worker create on ERESTART* Caleb Sander Mateos
2025-12-03 14:53 ` Jens Axboe [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=176477359158.834078.5263900730628607784.b4-ty@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ushankar@purestorage.com \
    /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.