File: io_uring_register_iowq_aff.3

package info (click to toggle)
liburing 2.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,212 kB
  • sloc: ansic: 58,515; sh: 816; makefile: 598; cpp: 32
file content (67 lines) | stat: -rw-r--r-- 1,814 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
.\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
.\"
.\" SPDX-License-Identifier: LGPL-2.0-or-later
.\"
.TH io_uring_register_iowq_aff 3 "March 13, 2022" "liburing-2.2" "liburing Manual"
.SH NAME
io_uring_register_iowq_aff \- register async worker CPU affinities
.SH SYNOPSIS
.nf
.B #include <sched.h>
.B #include <liburing.h>
.PP
.BI "int io_uring_register_iowq_aff(struct io_uring *" ring ","
.BI "                               size_t " cpusz ","
.BI "                               const cpu_set_t *" mask ");
.PP
.BI "void io_uring_unregister_iowq_aff(struct io_uring *" ring ");"
.fi
.SH DESCRIPTION
.PP
The
.BR io_uring_prep_register_iowq_aff (3)
function registers a set of CPU affinities to be used by the io_uring async
workers. By default, io_uring async workers are allowed to run on any CPU in
the system. If this function is called with
.I ring
set to the ring in question and
.I mask
set to a pointer to a
.B cpu_set_t
value and
.I cpusz
set to the size of the CPU set, then async workers will only be allowed to run
on the CPUs specified in the mask. Existing workers may need to hit a schedule
point before they are migrated.

For unregistration,
.BR io_uring_unregister_iowq_aff (3)
may be called to restore CPU affinities to the default.

Applications must define
.B _GNU_SOURCE
to obtain the definition of this helper, as
.I cpu_set_t
will not be defined without it.

.SH RETURN VALUE
Returns
.B 0
on success, or any of the following values in case of error.
.TP
.B -EFAULT
The kernel was unable to copy the memory pointer to by
.I mask
as it was invalid.
.TP
.B -ENOMEM
The kernel was unable to allocate memory for the new CPU mask.
.TP
.B -EINVAL
.I cpusz
or
.I mask
was NULL/0, or any other value specified was invalid.
.SH SEE ALSO
.BR io_uring_queue_init (3),
.BR io_uring_register (2)