Closed wwwwxxxxhhhh closed 1 month ago
Sorry, put the file here. [Uploading error_result.docx…]()
Please just paste your code and the errors into the GitHub issue, I really don't want to download random word documents for something that should just be readily readable in here. Include what kernel you are using as well.
Hi, I directly simplified the wq aff. c program for testing, and the program is as follows: ##################################################################### / SPDX-License-Identifier: MIT / /*
// #include "helpers.h"
static int test(int sqpoll) { struct io_uring_params p = { }; struct io_uring ring; struct io_uring_sqe *sqe; char buf[64]; int fds[2], ret; cpu_set_t set;
if (sqpoll) {
p.flags = IORING_SETUP_SQPOLL | IORING_SETUP_SQ_AFF;
p.sq_thread_cpu = SQPOLL_CPU;
}
io_uring_queue_init_params(8, &ring, &p);
CPU_ZERO(&set);
CPU_SET(IOWQ_CPU, &set);
ret = io_uring_register_iowq_aff(&ring, sizeof(set), &set);
if (ret) {
fprintf(stderr, "register aff: %d\n", ret);
}
if (pipe(fds) < 0) {
perror("pipe");
}
sqe = io_uring_get_sqe(&ring);
io_uring_prep_read(sqe, fds[0], buf, sizeof(buf), 0);
sqe->flags |= IOSQE_ASYNC;
io_uring_submit(&ring);
usleep(10000);
io_uring_queue_exit(&ring);
return ret;
}
int main(int argc, char *argv[]) { int ret; ret = test(1); return 0; }
Hi, The test results are as follows: [root@localhost wxh]# ./wxh_iouring io_uring.conf register aff: -22 [root@localhost wxh]# ./wxh_iouring register aff: -22
Hi, The kernel version I tested is as follows: 5.10.0-136.12.0.86.oe2203sp1.x86_64
I don't know what version of kernel that is, but if you get -EINVAL, then it's too old to support WQ_AFF. The current 5.10-stable trees do support it, but older ones do not.
Hi, I want to call the interface io_uring-register_iowq-aff to bind the worker thread to CPU1, but the result returns Unknown error -22, and the collected error is displayed as Success.Error result, please check the docx file.
The actual worker thread did not successfully bind to the specified CPU. What should I do to correctly specify the corresponding CPU? error_result.docx Thanks.