On 6/15/22 18:26, Pavel Begunkov wrote:
On 6/15/22 10:41, Hao Xu wrote:
On 6/14/22 22:37, Pavel Begunkov wrote:
Add a new IORING_SETUP_SINGLE_ISSUER flag and the userspace visible part
of it, i.e. put limitations of submitters. Also, don't allow it together
with IOPOLL as we're not going to put it to good use.
Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
include/uapi/linux/io_uring.h | 5 ++++-
io_uring/io_uring.c | 7 +++++--
io_uring/io_uring_types.h | 1 +
io_uring/tctx.c | 27 ++++++++++++++++++++++++---
io_uring/tctx.h | 4 ++--
5 files changed, 36 insertions(+), 8 deletions(-)
[...]
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 15d209f334eb..4b90439808e3 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3020,6 +3020,8 @@ static __cold void io_ring_ctx_free(struct
io_ring_ctx *ctx)
io_destroy_buffers(ctx);
if (ctx->sq_creds)
put_cred(ctx->sq_creds);
+ if (ctx->submitter_task)
+ put_task_struct(ctx->submitter_task);
/* there are no registered resources left, nobody uses it */
if (ctx->rsrc_node)
@@ -3752,7 +3754,7 @@ static int io_uring_install_fd(struct
io_ring_ctx *ctx, struct file *file)
if (fd < 0)
return fd;
- ret = io_uring_add_tctx_node(ctx);
+ ret = __io_uring_add_tctx_node(ctx, false);
^^^^^^
Note this one
My bad, I read it wrong...