Git Product home page Git Product logo

Comments (6)

wwwwxxxxhhhh avatar wwwwxxxxhhhh commented on August 22, 2024

Sorry, put the file here.
Uploading error_result.docx…

from liburing.

axboe avatar axboe commented on August 22, 2024

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.

from liburing.

wwwwxxxxhhhh avatar wwwwxxxxhhhh commented on August 22, 2024

Hi,
I directly simplified the wq aff. c program for testing, and the program is as follows:
#####################################################################
/* SPDX-License-Identifier: MIT /
/

  • Description: test that io-wq affinity is correctly set for SQPOLL
    */
    #define _GNU_SOURCE
    #include <stdio.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <stdlib.h>
    #include <string.h>
    #include <liburing.h>
    #include <sched.h>
    // #include "helpers.h"

#define IOWQ_CPU 0
#define SQPOLL_CPU 1

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;
}

from liburing.

wwwwxxxxhhhh avatar wwwwxxxxhhhh commented on August 22, 2024

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

from liburing.

wwwwxxxxhhhh avatar wwwwxxxxhhhh commented on August 22, 2024

Hi,
The kernel version I tested is as follows:
5.10.0-136.12.0.86.oe2203sp1.x86_64

from liburing.

axboe avatar axboe commented on August 22, 2024

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.

from liburing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.