Repository navigation
Commit d7462bf
io_uring: fix bug in slow unregistering of nodes
[ Upstream commit b36a205 ]
In some cases io_rsrc_ref_quiesce will call io_rsrc_node_switch_start,
and then immediately flush the delayed work queue &ctx->rsrc_put_work.
However the percpu_ref_put does not immediately destroy the node, it
will be called asynchronously via RCU. That ends up with
io_rsrc_node_ref_zero only being called after rsrc_put_work has been
flushed, and so the process ends up sleeping for 1 second unnecessarily.
This patch executes the put code immediately if we are busy
quiescing.
Fixes: 4a38aed ("io_uring: batch reap of dead file registrations")
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220121123856.3557884-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 6ef46e1 commit d7462bf
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7761 | 7761 | | |
7762 | 7762 | | |
7763 | 7763 | | |
| 7764 | + | |
7764 | 7765 | | |
7765 | 7766 | | |
7766 | 7767 | | |
7767 | 7768 | | |
| 7769 | + | |
| 7770 | + | |
| 7771 | + | |
| 7772 | + | |
7768 | 7773 | | |
7769 | 7774 | | |
7770 | 7775 | | |
| |||
7777 | 7782 | | |
7778 | 7783 | | |
7779 | 7784 | | |
7780 | | - | |
| 7785 | + | |
7781 | 7786 | | |
7782 | 7787 | | |
7783 | 7788 | | |
| |||
0 commit comments