Commit b36a205
io_uring: fix bug in slow unregistering of nodes
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>1 parent dd81e1c commit b36a205
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7822 | 7822 | | |
7823 | 7823 | | |
7824 | 7824 | | |
| 7825 | + | |
7825 | 7826 | | |
7826 | 7827 | | |
7827 | 7828 | | |
7828 | 7829 | | |
| 7830 | + | |
| 7831 | + | |
| 7832 | + | |
| 7833 | + | |
7829 | 7834 | | |
7830 | 7835 | | |
7831 | 7836 | | |
| |||
7838 | 7843 | | |
7839 | 7844 | | |
7840 | 7845 | | |
7841 | | - | |
| 7846 | + | |
7842 | 7847 | | |
7843 | 7848 | | |
7844 | 7849 | | |
| |||
0 commit comments