summaryrefslogtreecommitdiffstats
path: root/io_uring/sqpoll.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-05-25 17:13:39 +0200
committerJens Axboe <axboe@kernel.dk>2022-07-25 02:39:12 +0200
commit17437f311490d873a5157f65a84317d16270fd38 (patch)
tree840446aa33554e40b8ba0f0fc68cd7707fe26b58 /io_uring/sqpoll.h
parentio_uring: move timeout opcodes and handling into its own file (diff)
downloadlinux-17437f311490d873a5157f65a84317d16270fd38.tar.xz
linux-17437f311490d873a5157f65a84317d16270fd38.zip
io_uring: move SQPOLL related handling into its own file
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/sqpoll.h')
-rw-r--r--io_uring/sqpoll.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/io_uring/sqpoll.h b/io_uring/sqpoll.h
new file mode 100644
index 000000000000..0c3fbcd1f583
--- /dev/null
+++ b/io_uring/sqpoll.h
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+
+struct io_sq_data {
+ refcount_t refs;
+ atomic_t park_pending;
+ struct mutex lock;
+
+ /* ctx's that are using this sqd */
+ struct list_head ctx_list;
+
+ struct task_struct *thread;
+ struct wait_queue_head wait;
+
+ unsigned sq_thread_idle;
+ int sq_cpu;
+ pid_t task_pid;
+ pid_t task_tgid;
+
+ unsigned long state;
+ struct completion exited;
+};
+
+int io_sq_offload_create(struct io_ring_ctx *ctx, struct io_uring_params *p);
+void io_sq_thread_finish(struct io_ring_ctx *ctx);
+void io_sq_thread_stop(struct io_sq_data *sqd);
+void io_sq_thread_park(struct io_sq_data *sqd);
+void io_sq_thread_unpark(struct io_sq_data *sqd);
+void io_put_sq_data(struct io_sq_data *sqd);
+int io_sqpoll_wait_sq(struct io_ring_ctx *ctx);