[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250902215144.1925256-1-csander@purestorage.com>
Date: Tue, 2 Sep 2025 15:51:43 -0600
From: Caleb Sander Mateos <csander@...estorage.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: Caleb Sander Mateos <csander@...estorage.com>,
io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] io_uring: remove WRITE_ONCE() in io_uring_create()
There's no need to use WRITE_ONCE() to set ctx->submitter_task in
io_uring_create() since no other thread can access the io_ring_ctx until
a file descriptor is associated with it. So use a normal assignment
instead of WRITE_ONCE().
Signed-off-by: Caleb Sander Mateos <csander@...estorage.com>
---
io_uring/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 6c07efac977c..545a7d5eefec 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3890,11 +3890,11 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,
goto err;
}
if (ctx->flags & IORING_SETUP_SINGLE_ISSUER
&& !(ctx->flags & IORING_SETUP_R_DISABLED))
- WRITE_ONCE(ctx->submitter_task, get_task_struct(current));
+ ctx->submitter_task = get_task_struct(current);
file = io_uring_get_file(ctx);
if (IS_ERR(file)) {
ret = PTR_ERR(file);
goto err;
--
2.45.2
Powered by blists - more mailing lists