sqpoll.h 848 B

12345678910111213141516171819202122232425262728293031
  1. // SPDX-License-Identifier: GPL-2.0
  2. struct io_sq_data {
  3. refcount_t refs;
  4. atomic_t park_pending;
  5. struct mutex lock;
  6. /* ctx's that are using this sqd */
  7. struct list_head ctx_list;
  8. struct task_struct *thread;
  9. struct wait_queue_head wait;
  10. unsigned sq_thread_idle;
  11. int sq_cpu;
  12. pid_t task_pid;
  13. pid_t task_tgid;
  14. u64 work_time;
  15. unsigned long state;
  16. struct completion exited;
  17. };
  18. int io_sq_offload_create(struct io_ring_ctx *ctx, struct io_uring_params *p);
  19. void io_sq_thread_finish(struct io_ring_ctx *ctx);
  20. void io_sq_thread_stop(struct io_sq_data *sqd);
  21. void io_sq_thread_park(struct io_sq_data *sqd);
  22. void io_sq_thread_unpark(struct io_sq_data *sqd);
  23. void io_put_sq_data(struct io_sq_data *sqd);
  24. void io_sqpoll_wait_sq(struct io_ring_ctx *ctx);
  25. int io_sqpoll_wq_cpu_affinity(struct io_ring_ctx *ctx, cpumask_var_t mask);