summaryrefslogtreecommitdiff
path: root/io_uring/tctx.h
diff options
context:
space:
mode:
authorDylan Yudaken <dylany@fb.com>2022-06-22 16:40:23 +0300
committerJens Axboe <axboe@kernel.dk>2022-07-25 03:39:15 +0300
commitf88262e60bb9cb5740891672ce9f405e7f9393e5 (patch)
treebca01661645c35ef7958fd5b0a5f9438d9b9b477 /io_uring/tctx.h
parentc34398a8c018e0d3d2d30b718d03c7290c696f51 (diff)
downloadlinux-f88262e60bb9cb5740891672ce9f405e7f9393e5.tar.xz
io_uring: lockless task list
With networking use cases we see contention on the spinlock used to protect the task_list when multiple threads try and add completions at once. Instead we can use a lockless list, and assume that the first caller to add to the list is responsible for kicking off task work. Signed-off-by: Dylan Yudaken <dylany@fb.com> Link: https://lore.kernel.org/r/20220622134028.2013417-4-dylany@fb.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/tctx.h')
-rw-r--r--io_uring/tctx.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/io_uring/tctx.h b/io_uring/tctx.h
index c8566ea5dca4..8a33ff6e5d91 100644
--- a/io_uring/tctx.h
+++ b/io_uring/tctx.h
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
+#include <linux/llist.h>
+
/*
* Arbitrary limit, can be raised if need be
*/
@@ -19,9 +21,7 @@ struct io_uring_task {
struct percpu_counter inflight;
struct { /* task_work */
- spinlock_t task_lock;
- bool task_running;
- struct io_wq_work_list task_list;
+ struct llist_head task_list;
struct callback_head task_work;
} ____cacheline_aligned_in_smp;
};