diff options
| author | Caleb Sander Mateos <csander@purestorage.com> | 2025-12-02 13:57:44 -0700 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-12-04 07:18:02 -0700 |
| commit | 34c78b8610a9befdcc139d34a7c98365f018026d (patch) | |
| tree | 2374247f8a55b8ef1fdd309f1efad405c3a3ca7b /rust/proc-macro2/parse.rs | |
| parent | 84230ad2d2afbf0c44c32967e525c0ad92e26b4e (diff) | |
io_uring/io-wq: always retry worker create on ERESTART*
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.
Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'rust/proc-macro2/parse.rs')
0 files changed, 0 insertions, 0 deletions
