Message ID | 20220819152738.1111255-16-hao.xu@linux.dev (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | uringlet | expand |
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 0c14b90b8b47..a109dcb48702 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1582,7 +1582,14 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags) revert_creds(creds); if (ret == IOU_OK) { - if (issue_flags & IO_URING_F_COMPLETE_DEFER) + bool uringlet = req->ctx->flags & IORING_SETUP_URINGLET; + bool scheduled = false; + + if (uringlet) + scheduled = + io_worker_test_scheduled(current->worker_private); + + if ((issue_flags & IO_URING_F_COMPLETE_DEFER) && !scheduled) io_req_complete_defer(req); else io_req_complete_post(req);