summaryrefslogtreecommitdiffstats
path: root/io_uring/cancel.h
diff options
context:
space:
mode:
authorHao Xu <howeyxu@tencent.com>2022-06-16 10:22:02 +0100
committerJens Axboe <axboe@kernel.dk>2022-07-24 18:39:13 -0600
commit38513c464d3d45b4088c82f6e42d9cdbc5ee57e6 (patch)
treedefce3565cffbddce9dda6a8466298939015584c /io_uring/cancel.h
parent3654ab0c51a91036d15dd2fd9c2809317edf2228 (diff)
downloadlinux-stable-38513c464d3d45b4088c82f6e42d9cdbc5ee57e6.tar.gz
linux-stable-38513c464d3d45b4088c82f6e42d9cdbc5ee57e6.tar.bz2
linux-stable-38513c464d3d45b4088c82f6e42d9cdbc5ee57e6.zip
io_uring: switch cancel_hash to use per entry spinlock
Add a new io_hash_bucket structure so that each bucket in cancel_hash has separate spinlock. Use per entry lock for cancel_hash, this removes some completion lock invocation and remove contension between different cancel_hash entries. Signed-off-by: Hao Xu <howeyxu@tencent.com> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/05d1e135b0c8bce9d1441e6346776589e5783e26.1655371007.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/cancel.h')
-rw-r--r--io_uring/cancel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/io_uring/cancel.h b/io_uring/cancel.h
index 4f35d8696325..556a7dcf160e 100644
--- a/io_uring/cancel.h
+++ b/io_uring/cancel.h
@@ -4,3 +4,9 @@ int io_async_cancel_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_async_cancel(struct io_kiocb *req, unsigned int issue_flags);
int io_try_cancel(struct io_kiocb *req, struct io_cancel_data *cd);
+void init_hash_table(struct io_hash_bucket *hash_table, unsigned size);
+
+struct io_hash_bucket {
+ spinlock_t lock;
+ struct hlist_head list;
+} ____cacheline_aligned_in_smp;