diff options
| author | Chen-Yu Tsai <wens@csie.org> | 2025-07-15 18:34:10 +0300 |
|---|---|---|
| committer | Chen-Yu Tsai <wens@csie.org> | 2025-07-15 18:34:10 +0300 |
| commit | ca5ad734d30f30a577f705926d6e16a87513a2a7 (patch) | |
| tree | b5fb169a86ac59892bd3b60c2df13e8a7cef360d /io_uring/sqpoll.h | |
| parent | 082c6a2d06c0831d236760a29953355845eee988 (diff) | |
| parent | f99d4fccd2185176baf4ecac9a49d280fc62b953 (diff) | |
| download | linux-ca5ad734d30f30a577f705926d6e16a87513a2a7.tar.xz | |
Merge branch 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm into sunxi/dt-for-6.17
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Diffstat (limited to 'io_uring/sqpoll.h')
| -rw-r--r-- | io_uring/sqpoll.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/io_uring/sqpoll.h b/io_uring/sqpoll.h index 4171666b1cf4..b83dcdec9765 100644 --- a/io_uring/sqpoll.h +++ b/io_uring/sqpoll.h @@ -8,7 +8,7 @@ struct io_sq_data { /* ctx's that are using this sqd */ struct list_head ctx_list; - struct task_struct *thread; + struct task_struct __rcu *thread; struct wait_queue_head wait; unsigned sq_thread_idle; @@ -29,3 +29,9 @@ void io_sq_thread_unpark(struct io_sq_data *sqd); void io_put_sq_data(struct io_sq_data *sqd); void io_sqpoll_wait_sq(struct io_ring_ctx *ctx); int io_sqpoll_wq_cpu_affinity(struct io_ring_ctx *ctx, cpumask_var_t mask); + +static inline struct task_struct *sqpoll_task_locked(struct io_sq_data *sqd) +{ + return rcu_dereference_protected(sqd->thread, + lockdep_is_held(&sqd->lock)); +} |
