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 <haoxu@xxxxxxxxxxxxxxxxx> --- fs/io_uring.c | 1 + include/uapi/linux/io_uring.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index ca9172f51a77..9f7101f3c28d 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -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; diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index 79126d5cd289..07b624be7a66 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -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; -- 2.24.4