io_uring: store pid of sqthread for userspace usage
PATCH 2/2 io_uring: store pid of sqthread for userspace usage
users may want to change the schedule policy and priority of sqthread. So it's good to store this info in io_uring_params.
Signed-off-by Hao Xu <[email protected]>
--- fs/io_uring.c | 1 + include/uapi/linux/io_uring.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)
fs/io_uring.c +1 -0
@@ -8054,6 +8054,7 @@ static int io_sq_offload_create(struct io_ring_ctx *ctx,wake_up_new_task (tsk);if (ret) goto err; + p->sq_thread_pid =task_pid_vnr (tsk); }else if (p->flags &IORING_SETUP_SQ_AFF ) {/* Can't have SQ_AFF without SQPOLL */ ret = -EINVAL ;
include/uapi/linux/io_uring.h +4 -1
@@ -254,7 +254,10 @@ struct io_uring_params {__u32 sq_entries;__u32 cq_entries;__u32 flags; -__u32 sq_thread_cpu; +union { +__u32 sq_thread_cpu; +__s32 sq_thread_pid; + };__u32 sq_thread_idle;__u32 features;__u32 wq_fd;
Signature · 1 line
2.24.4