diff mbox series

[2/3] io_uring: add an io_hash_bucket structure for smaller granularity lock

Message ID 20220606065716.270879-3-haoxu.linux@icloud.com (mailing list archive)
State New
Headers show
Series cancel_hash per entry lock | expand

Commit Message

Hao Xu June 6, 2022, 6:57 a.m. UTC
From: Hao Xu <howeyxu@tencent.com>

Add a new io_hash_bucket structure so that each bucket in cancel_hash
has separate spinlock. This is a prep patch for later use.

Signed-off-by: Hao Xu <howeyxu@tencent.com>
---
 io_uring/cancel.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Pavel Begunkov June 6, 2022, 11:55 a.m. UTC | #1
On 6/6/22 07:57, Hao Xu wrote:
> From: Hao Xu <howeyxu@tencent.com>
> 
> Add a new io_hash_bucket structure so that each bucket in cancel_hash
> has separate spinlock. This is a prep patch for later use.
> 
> Signed-off-by: Hao Xu <howeyxu@tencent.com>
> ---
>   io_uring/cancel.h | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/io_uring/cancel.h b/io_uring/cancel.h
> index 4f35d8696325..b9218310611c 100644
> --- a/io_uring/cancel.h
> +++ b/io_uring/cancel.h
> @@ -4,3 +4,8 @@ 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);
> +
> +struct io_hash_bucket {
> +	spinlock_t		lock;
> +	struct hlist_head	list;
> +};

please, in future just merge such patches into the next one,
separately it doesn't do anything meaningful, the struct is
not used here and IMHO only makes reviewing harder.
diff mbox series

Patch

diff --git a/io_uring/cancel.h b/io_uring/cancel.h
index 4f35d8696325..b9218310611c 100644
--- a/io_uring/cancel.h
+++ b/io_uring/cancel.h
@@ -4,3 +4,8 @@  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);
+
+struct io_hash_bucket {
+	spinlock_t		lock;
+	struct hlist_head	list;
+};