Skip to content

Commit c3b4909

Browse files
isilenceaxboe
authored andcommitted
io_uring: don't use complete_post in kbuf
Now we're handling IOPOLL completions more generically, get rid uses of _post() and send requests through the normal path. It may have some extra mertis performance wise, but we don't care much as there is a better interface for selected buffers. Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/4deded706587f55b006dc33adf0c13cfc3b2319f.1669310258.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 10d8bc3 commit c3b4909

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

io_uring/kbuf.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,11 @@ int io_remove_buffers(struct io_kiocb *req, unsigned int issue_flags)
306306
if (!bl->buf_nr_pages)
307307
ret = __io_remove_buffers(ctx, bl, p->nbufs);
308308
}
309+
io_ring_submit_unlock(ctx, issue_flags);
309310
if (ret < 0)
310311
req_set_fail(req);
311-
312-
/* complete before unlock, IOPOLL may need the lock */
313312
io_req_set_res(req, ret, 0);
314-
io_req_complete_post(req, 0);
315-
io_ring_submit_unlock(ctx, issue_flags);
316-
return IOU_ISSUE_SKIP_COMPLETE;
313+
return IOU_OK;
317314
}
318315

319316
int io_provide_buffers_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
@@ -458,13 +455,12 @@ int io_provide_buffers(struct io_kiocb *req, unsigned int issue_flags)
458455

459456
ret = io_add_buffers(ctx, p, bl);
460457
err:
458+
io_ring_submit_unlock(ctx, issue_flags);
459+
461460
if (ret < 0)
462461
req_set_fail(req);
463-
/* complete before unlock, IOPOLL may need the lock */
464462
io_req_set_res(req, ret, 0);
465-
io_req_complete_post(req, 0);
466-
io_ring_submit_unlock(ctx, issue_flags);
467-
return IOU_ISSUE_SKIP_COMPLETE;
463+
return IOU_OK;
468464
}
469465

470466
int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)

0 commit comments

Comments
 (0)