1io_uring_register_iowq_aff(3) liburing Manual io_uring_register_iowq_aff(3)
2
3
4
6 io_uring_register_iowq_aff - register async worker CPU affinities
7
9 #include <sched.h>
10 #include <liburing.h>
11
12 int io_uring_register_iowq_aff(struct io_uring *ring,
13 size_t cpusz,
14 const cpu_set_t *mask);
15
16 void io_uring_unregister_iowq_aff(struct io_uring *ring);
17
19 The io_uring_prep_register_iowq_aff(3) function registers a set of CPU
20 affinities to be used by the io_uring async workers. By default, io_ur‐
21 ing async workers are allowed to run on any CPU in the system. If this
22 function is called with ring set to the ring in question and mask set
23 to a pointer to a cpu_set_t value and cpusz set to the size of the CPU
24 set, then async workers will only be allowed to run on the CPUs speci‐
25 fied in the mask. Existing workers may need to hit a schedule point be‐
26 fore they are migrated.
27
28 For unregistration, io_uring_unregister_iowq_aff(3) may be called to
29 restore CPU affinities to the default.
30
31
33 Returns 0 on success, or any of the following values in case of error.
34
35 -EFAULT
36 The kernel was unable to copy the memory pointer to by mask as
37 it was invalid.
38
39 -ENOMEM
40 The kernel was unable to allocate memory for the new CPU mask.
41
42 -EINVAL
43 cpusz or mask was NULL/0, or any other value specified was in‐
44 valid.
45
47 io_uring_queue_init(3), io_uring_register(2)
48
49
50
51liburing-2.2 March 13, 2022 io_uring_register_iowq_aff(3)