Commit 0453aad
io_uring/io-wq: limit retrying worker initialisation
If io-wq worker creation fails, we retry it by queueing up a task_work.
tasK_work is needed because it should be done from the user process
context. The problem is that retries are not limited, and if queueing a
task_work is the reason for the failure, we might get into an infinite
loop.
It doesn't seem to happen now but it would with the following patch
executing task_work in the freezer's loop. For now, arbitrarily limit the
number of attempts to create a worker.
Cc: [email protected]
Fixes: 3146cba ("io-wq: make worker creation resilient against signals")
Reported-by: Julian Orth <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
Link: https://lore.kernel.org/r/8280436925db88448c7c85c6656edee1a43029ea.1720634146.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <[email protected]>1 parent f7c696a commit 0453aad
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
745 | 747 | | |
746 | 748 | | |
747 | 749 | | |
748 | | - | |
| 750 | + | |
749 | 751 | | |
750 | 752 | | |
751 | 753 | | |
752 | 754 | | |
753 | 755 | | |
754 | 756 | | |
755 | 757 | | |
| 758 | + | |
| 759 | + | |
756 | 760 | | |
757 | 761 | | |
758 | 762 | | |
| |||
779 | 783 | | |
780 | 784 | | |
781 | 785 | | |
782 | | - | |
| 786 | + | |
783 | 787 | | |
784 | 788 | | |
785 | 789 | | |
| |||
846 | 850 | | |
847 | 851 | | |
848 | 852 | | |
849 | | - | |
| 853 | + | |
850 | 854 | | |
851 | 855 | | |
852 | 856 | | |
| |||
0 commit comments