Commit 04fc6c8
io_uring: save ctx put/get for task_work submit
Do a little trick in io_ring_ctx_free() briefly taking uring_lock, that
will wait for everyone currently holding it, so we can skip pinning ctx
with ctx->refs for __io_req_task_submit(), which is executed and loses
its refs/reqs while holding the lock.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 921b905 commit 04fc6c8
1 file changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2336 | 2336 | | |
2337 | 2337 | | |
2338 | 2338 | | |
| 2339 | + | |
2339 | 2340 | | |
2340 | 2341 | | |
2341 | 2342 | | |
| |||
2347 | 2348 | | |
2348 | 2349 | | |
2349 | 2350 | | |
2350 | | - | |
2351 | 2351 | | |
2352 | 2352 | | |
2353 | | - | |
2354 | 2353 | | |
2355 | 2354 | | |
2356 | 2355 | | |
2357 | 2356 | | |
2358 | 2357 | | |
2359 | 2358 | | |
2360 | 2359 | | |
2361 | | - | |
2362 | | - | |
2363 | 2360 | | |
2364 | | - | |
| 2361 | + | |
| 2362 | + | |
2365 | 2363 | | |
| 2364 | + | |
2366 | 2365 | | |
2367 | 2366 | | |
2368 | 2367 | | |
| |||
8707 | 8706 | | |
8708 | 8707 | | |
8709 | 8708 | | |
| 8709 | + | |
| 8710 | + | |
| 8711 | + | |
| 8712 | + | |
| 8713 | + | |
| 8714 | + | |
| 8715 | + | |
| 8716 | + | |
8710 | 8717 | | |
8711 | 8718 | | |
8712 | 8719 | | |
| |||
0 commit comments