[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220926140304.1973990-2-dylany@fb.com>
Date: Mon, 26 Sep 2022 07:03:02 -0700
From: Dylan Yudaken <dylany@...com>
To: Jens Axboe <axboe@...nel.dk>,
Pavel Begunkov <asml.silence@...il.com>
CC: <io-uring@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<kernel-team@...com>, Dylan Yudaken <dylany@...com>
Subject: [PATCH 1/3] io_uring: register single issuer task at creation
Instead of picking the task from the first submitter task, rather use the
creator task.
The downside of this is that users are unable to move tasks before
submitting.
However this simplifies the logic here. For example CQEs are able to be
posted by io_uring_register, which could also be from a separate
task. This could be confusing as this does not count as a submit, and so
would not be the registered task.
Additionally this removes init logic from the submission path, which can
always be a bit confusing.
Signed-off-by: Dylan Yudaken <dylany@...com>
---
io_uring/io_uring.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 2965b354efc8..3f40defd721d 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3357,6 +3357,9 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,
goto err;
}
+ if (ctx->flags & IORING_SETUP_SINGLE_ISSUER)
+ ctx->submitter_task = get_task_struct(current);
+
file = io_uring_get_file(ctx);
if (IS_ERR(file)) {
ret = PTR_ERR(file);
--
2.30.2
Powered by blists - more mailing lists