polyphony 0.85 → 0.86
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/ext/polyphony/io_extensions.c +2 -3
- data/lib/polyphony/version.rb +1 -1
- data/polyphony.gemspec +1 -1
- data/test/test_backend.rb +1 -1
- data/test/test_signal.rb +3 -3
- data/vendor/liburing/.github/pull_request_template.md +86 -0
- data/vendor/liburing/.github/workflows/build.yml +85 -0
- data/vendor/liburing/.github/workflows/shellcheck.yml +20 -0
- data/vendor/liburing/.gitignore +149 -0
- data/vendor/liburing/COPYING +502 -0
- data/vendor/liburing/COPYING.GPL +339 -0
- data/vendor/liburing/LICENSE +7 -0
- data/vendor/liburing/Makefile +82 -0
- data/vendor/liburing/Makefile.common +5 -0
- data/vendor/liburing/Makefile.quiet +11 -0
- data/vendor/liburing/README +46 -0
- data/vendor/liburing/configure +486 -0
- data/vendor/liburing/debian/README.Debian +7 -0
- data/vendor/liburing/debian/changelog +27 -0
- data/vendor/liburing/debian/compat +1 -0
- data/vendor/liburing/debian/control +48 -0
- data/vendor/liburing/debian/copyright +49 -0
- data/vendor/liburing/debian/liburing-dev.install +4 -0
- data/vendor/liburing/debian/liburing-dev.manpages +6 -0
- data/vendor/liburing/debian/liburing1-udeb.install +1 -0
- data/vendor/liburing/debian/liburing1.install +1 -0
- data/vendor/liburing/debian/liburing1.symbols +32 -0
- data/vendor/liburing/debian/patches/series +1 -0
- data/vendor/liburing/debian/rules +81 -0
- data/vendor/liburing/debian/source/format +1 -0
- data/vendor/liburing/debian/source/local-options +2 -0
- data/vendor/liburing/debian/source/options +1 -0
- data/vendor/liburing/debian/watch +3 -0
- data/vendor/liburing/examples/Makefile +38 -0
- data/vendor/liburing/examples/io_uring-cp.c +282 -0
- data/vendor/liburing/examples/io_uring-test.c +112 -0
- data/vendor/liburing/examples/link-cp.c +193 -0
- data/vendor/liburing/examples/ucontext-cp.c +273 -0
- data/vendor/liburing/liburing.pc.in +12 -0
- data/vendor/liburing/liburing.spec +66 -0
- data/vendor/liburing/make-debs.sh +53 -0
- data/vendor/liburing/man/io_uring.7 +754 -0
- data/vendor/liburing/man/io_uring_cq_advance.3 +35 -0
- data/vendor/liburing/man/io_uring_cq_ready.3 +25 -0
- data/vendor/liburing/man/io_uring_cqe_get_data.3 +34 -0
- data/vendor/liburing/man/io_uring_cqe_seen.3 +32 -0
- data/vendor/liburing/man/io_uring_enter.2 +1483 -0
- data/vendor/liburing/man/io_uring_free_probe.3 +24 -0
- data/vendor/liburing/man/io_uring_get_probe.3 +29 -0
- data/vendor/liburing/man/io_uring_get_sqe.3 +38 -0
- data/vendor/liburing/man/io_uring_opcode_supported.3 +29 -0
- data/vendor/liburing/man/io_uring_prep_msg_ring.3 +58 -0
- data/vendor/liburing/man/io_uring_prep_read.3 +50 -0
- data/vendor/liburing/man/io_uring_prep_read_fixed.3 +54 -0
- data/vendor/liburing/man/io_uring_prep_readv.3 +51 -0
- data/vendor/liburing/man/io_uring_prep_readv2.3 +79 -0
- data/vendor/liburing/man/io_uring_prep_write.3 +50 -0
- data/vendor/liburing/man/io_uring_prep_write_fixed.3 +54 -0
- data/vendor/liburing/man/io_uring_prep_writev.3 +51 -0
- data/vendor/liburing/man/io_uring_prep_writev2.3 +78 -0
- data/vendor/liburing/man/io_uring_queue_exit.3 +27 -0
- data/vendor/liburing/man/io_uring_queue_init.3 +44 -0
- data/vendor/liburing/man/io_uring_register.2 +688 -0
- data/vendor/liburing/man/io_uring_register_buffers.3 +41 -0
- data/vendor/liburing/man/io_uring_register_files.3 +35 -0
- data/vendor/liburing/man/io_uring_setup.2 +534 -0
- data/vendor/liburing/man/io_uring_sq_ready.3 +25 -0
- data/vendor/liburing/man/io_uring_sq_space_left.3 +25 -0
- data/vendor/liburing/man/io_uring_sqe_set_data.3 +30 -0
- data/vendor/liburing/man/io_uring_sqe_set_flags.3 +60 -0
- data/vendor/liburing/man/io_uring_sqring_wait.3 +30 -0
- data/vendor/liburing/man/io_uring_submit.3 +29 -0
- data/vendor/liburing/man/io_uring_submit_and_wait.3 +34 -0
- data/vendor/liburing/man/io_uring_submit_and_wait_timeout.3 +49 -0
- data/vendor/liburing/man/io_uring_unregister_buffers.3 +26 -0
- data/vendor/liburing/man/io_uring_unregister_files.3 +26 -0
- data/vendor/liburing/man/io_uring_wait_cqe.3 +33 -0
- data/vendor/liburing/man/io_uring_wait_cqe_nr.3 +36 -0
- data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +39 -0
- data/vendor/liburing/man/io_uring_wait_cqes.3 +46 -0
- data/vendor/liburing/src/Makefile +89 -0
- data/vendor/liburing/src/arch/aarch64/syscall.h +95 -0
- data/vendor/liburing/src/arch/generic/lib.h +21 -0
- data/vendor/liburing/src/arch/generic/syscall.h +87 -0
- data/vendor/liburing/src/arch/syscall-defs.h +67 -0
- data/vendor/liburing/src/arch/x86/lib.h +32 -0
- data/vendor/liburing/src/arch/x86/syscall.h +160 -0
- data/vendor/liburing/src/include/liburing/barrier.h +81 -0
- data/vendor/liburing/src/include/liburing/io_uring.h +442 -0
- data/vendor/liburing/src/include/liburing.h +921 -0
- data/vendor/liburing/src/int_flags.h +8 -0
- data/vendor/liburing/src/lib.h +57 -0
- data/vendor/liburing/src/liburing.map +53 -0
- data/vendor/liburing/src/nolibc.c +48 -0
- data/vendor/liburing/src/queue.c +403 -0
- data/vendor/liburing/src/register.c +293 -0
- data/vendor/liburing/src/setup.c +332 -0
- data/vendor/liburing/src/syscall.c +47 -0
- data/vendor/liburing/src/syscall.h +103 -0
- data/vendor/liburing/test/232c93d07b74-test.c +306 -0
- data/vendor/liburing/test/35fa71a030ca-test.c +329 -0
- data/vendor/liburing/test/500f9fbadef8-test.c +89 -0
- data/vendor/liburing/test/7ad0e4b2f83c-test.c +93 -0
- data/vendor/liburing/test/8a9973408177-test.c +106 -0
- data/vendor/liburing/test/917257daa0fe-test.c +53 -0
- data/vendor/liburing/test/Makefile +244 -0
- data/vendor/liburing/test/a0908ae19763-test.c +58 -0
- data/vendor/liburing/test/a4c0b3decb33-test.c +180 -0
- data/vendor/liburing/test/accept-link.c +254 -0
- data/vendor/liburing/test/accept-reuse.c +164 -0
- data/vendor/liburing/test/accept-test.c +79 -0
- data/vendor/liburing/test/accept.c +477 -0
- data/vendor/liburing/test/across-fork.c +283 -0
- data/vendor/liburing/test/b19062a56726-test.c +53 -0
- data/vendor/liburing/test/b5837bd5311d-test.c +77 -0
- data/vendor/liburing/test/ce593a6c480a-test.c +136 -0
- data/vendor/liburing/test/close-opath.c +122 -0
- data/vendor/liburing/test/config +10 -0
- data/vendor/liburing/test/connect.c +398 -0
- data/vendor/liburing/test/cq-full.c +96 -0
- data/vendor/liburing/test/cq-overflow.c +294 -0
- data/vendor/liburing/test/cq-peek-batch.c +102 -0
- data/vendor/liburing/test/cq-ready.c +94 -0
- data/vendor/liburing/test/cq-size.c +64 -0
- data/vendor/liburing/test/d4ae271dfaae-test.c +96 -0
- data/vendor/liburing/test/d77a67ed5f27-test.c +65 -0
- data/vendor/liburing/test/defer.c +307 -0
- data/vendor/liburing/test/double-poll-crash.c +185 -0
- data/vendor/liburing/test/drop-submit.c +92 -0
- data/vendor/liburing/test/eeed8b54e0df-test.c +114 -0
- data/vendor/liburing/test/empty-eownerdead.c +45 -0
- data/vendor/liburing/test/eventfd-disable.c +151 -0
- data/vendor/liburing/test/eventfd-reg.c +76 -0
- data/vendor/liburing/test/eventfd-ring.c +97 -0
- data/vendor/liburing/test/eventfd.c +112 -0
- data/vendor/liburing/test/exec-target.c +6 -0
- data/vendor/liburing/test/exit-no-cleanup.c +117 -0
- data/vendor/liburing/test/fadvise.c +202 -0
- data/vendor/liburing/test/fallocate.c +249 -0
- data/vendor/liburing/test/fc2a85cb02ef-test.c +131 -0
- data/vendor/liburing/test/file-register.c +858 -0
- data/vendor/liburing/test/file-update.c +173 -0
- data/vendor/liburing/test/file-verify.c +629 -0
- data/vendor/liburing/test/files-exit-hang-poll.c +128 -0
- data/vendor/liburing/test/files-exit-hang-timeout.c +134 -0
- data/vendor/liburing/test/fixed-link.c +90 -0
- data/vendor/liburing/test/fpos.c +252 -0
- data/vendor/liburing/test/fsync.c +224 -0
- data/vendor/liburing/test/hardlink.c +136 -0
- data/vendor/liburing/test/helpers.c +135 -0
- data/vendor/liburing/test/helpers.h +67 -0
- data/vendor/liburing/test/io-cancel.c +550 -0
- data/vendor/liburing/test/io_uring_enter.c +296 -0
- data/vendor/liburing/test/io_uring_register.c +676 -0
- data/vendor/liburing/test/io_uring_setup.c +192 -0
- data/vendor/liburing/test/iopoll.c +372 -0
- data/vendor/liburing/test/lfs-openat-write.c +119 -0
- data/vendor/liburing/test/lfs-openat.c +275 -0
- data/vendor/liburing/test/link-timeout.c +1107 -0
- data/vendor/liburing/test/link.c +496 -0
- data/vendor/liburing/test/link_drain.c +229 -0
- data/vendor/liburing/test/madvise.c +195 -0
- data/vendor/liburing/test/mkdir.c +108 -0
- data/vendor/liburing/test/msg-ring.c +234 -0
- data/vendor/liburing/test/multicqes_drain.c +387 -0
- data/vendor/liburing/test/nop-all-sizes.c +99 -0
- data/vendor/liburing/test/nop.c +115 -0
- data/vendor/liburing/test/open-close.c +261 -0
- data/vendor/liburing/test/openat2.c +308 -0
- data/vendor/liburing/test/personality.c +204 -0
- data/vendor/liburing/test/pipe-eof.c +83 -0
- data/vendor/liburing/test/pipe-reuse.c +105 -0
- data/vendor/liburing/test/poll-cancel-ton.c +135 -0
- data/vendor/liburing/test/poll-cancel.c +228 -0
- data/vendor/liburing/test/poll-link.c +230 -0
- data/vendor/liburing/test/poll-many.c +208 -0
- data/vendor/liburing/test/poll-mshot-update.c +273 -0
- data/vendor/liburing/test/poll-ring.c +48 -0
- data/vendor/liburing/test/poll-v-poll.c +353 -0
- data/vendor/liburing/test/poll.c +109 -0
- data/vendor/liburing/test/pollfree.c +426 -0
- data/vendor/liburing/test/probe.c +135 -0
- data/vendor/liburing/test/read-write.c +876 -0
- data/vendor/liburing/test/register-restrictions.c +633 -0
- data/vendor/liburing/test/rename.c +135 -0
- data/vendor/liburing/test/ring-leak.c +173 -0
- data/vendor/liburing/test/ring-leak2.c +249 -0
- data/vendor/liburing/test/rsrc_tags.c +449 -0
- data/vendor/liburing/test/runtests-loop.sh +16 -0
- data/vendor/liburing/test/runtests.sh +170 -0
- data/vendor/liburing/test/rw_merge_test.c +97 -0
- data/vendor/liburing/test/self.c +91 -0
- data/vendor/liburing/test/send_recv.c +286 -0
- data/vendor/liburing/test/send_recvmsg.c +345 -0
- data/vendor/liburing/test/sendmsg_fs_cve.c +200 -0
- data/vendor/liburing/test/shared-wq.c +84 -0
- data/vendor/liburing/test/short-read.c +75 -0
- data/vendor/liburing/test/shutdown.c +165 -0
- data/vendor/liburing/test/sigfd-deadlock.c +74 -0
- data/vendor/liburing/test/skip-cqe.c +429 -0
- data/vendor/liburing/test/socket-rw-eagain.c +158 -0
- data/vendor/liburing/test/socket-rw-offset.c +157 -0
- data/vendor/liburing/test/socket-rw.c +145 -0
- data/vendor/liburing/test/splice.c +512 -0
- data/vendor/liburing/test/sq-full-cpp.cc +45 -0
- data/vendor/liburing/test/sq-full.c +45 -0
- data/vendor/liburing/test/sq-poll-dup.c +204 -0
- data/vendor/liburing/test/sq-poll-kthread.c +169 -0
- data/vendor/liburing/test/sq-poll-share.c +137 -0
- data/vendor/liburing/test/sq-space_left.c +159 -0
- data/vendor/liburing/test/sqpoll-cancel-hang.c +157 -0
- data/vendor/liburing/test/sqpoll-disable-exit.c +196 -0
- data/vendor/liburing/test/sqpoll-exit-hang.c +78 -0
- data/vendor/liburing/test/sqpoll-sleep.c +69 -0
- data/vendor/liburing/test/statx.c +172 -0
- data/vendor/liburing/test/stdout.c +232 -0
- data/vendor/liburing/test/submit-link-fail.c +154 -0
- data/vendor/liburing/test/submit-reuse.c +239 -0
- data/vendor/liburing/test/symlink.c +116 -0
- data/vendor/liburing/test/teardowns.c +58 -0
- data/vendor/liburing/test/thread-exit.c +143 -0
- data/vendor/liburing/test/timeout-new.c +252 -0
- data/vendor/liburing/test/timeout-overflow.c +204 -0
- data/vendor/liburing/test/timeout.c +1523 -0
- data/vendor/liburing/test/unlink.c +112 -0
- data/vendor/liburing/test/wakeup-hang.c +162 -0
- metadata +223 -2
@@ -0,0 +1,44 @@
|
|
1
|
+
.\" Copyright (C) 2020 Jens Axboe <axboe@kernel.dk>
|
2
|
+
.\" Copyright (C) 2020 Red Hat, Inc.
|
3
|
+
.\"
|
4
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
5
|
+
.\"
|
6
|
+
.TH io_uring_queue_init 3 "July 10, 2020" "liburing-0.7" "liburing Manual"
|
7
|
+
.SH NAME
|
8
|
+
io_uring_queue_init - setup io_uring submission and completion queues
|
9
|
+
.SH SYNOPSIS
|
10
|
+
.nf
|
11
|
+
.BR "#include <liburing.h>"
|
12
|
+
.PP
|
13
|
+
.BI "int io_uring_queue_init(unsigned " entries ", struct io_uring *" ring ,
|
14
|
+
.BI " unsigned " flags );
|
15
|
+
.fi
|
16
|
+
.PP
|
17
|
+
.SH DESCRIPTION
|
18
|
+
.PP
|
19
|
+
The io_uring_queue_init() function executes the io_uring_setup syscall to
|
20
|
+
initialize the submission and completion queues in the kernel with at least
|
21
|
+
.I entries
|
22
|
+
entries and then maps the resulting file descriptor to memory shared between the
|
23
|
+
application and the kernel.
|
24
|
+
|
25
|
+
On success io_uring_queue_init() returns 0 and
|
26
|
+
.I ring
|
27
|
+
will point to the shared memory containing the io_uring queues. On failure
|
28
|
+
-errno is returned.
|
29
|
+
|
30
|
+
.I flags
|
31
|
+
will be passed through to the io_uring_setup syscall (see
|
32
|
+
.BR io_uring_setup (2)).
|
33
|
+
|
34
|
+
On success, the resources held by
|
35
|
+
.I ring
|
36
|
+
should be released via a corresponding call to
|
37
|
+
.BR io_uring_queue_exit (3).
|
38
|
+
.SH RETURN VALUE
|
39
|
+
.BR io_uring_queue_init (3)
|
40
|
+
returns 0 on success and -errno on failure.
|
41
|
+
.SH SEE ALSO
|
42
|
+
.BR io_uring_setup (2),
|
43
|
+
.BR mmap (2),
|
44
|
+
.BR io_uring_queue_exit (3)
|
@@ -0,0 +1,688 @@
|
|
1
|
+
.\" Copyright (C) 2019 Jens Axboe <axboe@kernel.dk>
|
2
|
+
.\" Copyright (C) 2019 Red Hat, Inc.
|
3
|
+
.\"
|
4
|
+
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
5
|
+
.\"
|
6
|
+
.TH IO_URING_REGISTER 2 2019-01-17 "Linux" "Linux Programmer's Manual"
|
7
|
+
.SH NAME
|
8
|
+
io_uring_register \- register files or user buffers for asynchronous I/O
|
9
|
+
.SH SYNOPSIS
|
10
|
+
.nf
|
11
|
+
.BR "#include <linux/io_uring.h>"
|
12
|
+
.PP
|
13
|
+
.BI "int io_uring_register(unsigned int " fd ", unsigned int " opcode ,
|
14
|
+
.BI " void *" arg ", unsigned int " nr_args );
|
15
|
+
.fi
|
16
|
+
.PP
|
17
|
+
.SH DESCRIPTION
|
18
|
+
.PP
|
19
|
+
|
20
|
+
The
|
21
|
+
.BR io_uring_register ()
|
22
|
+
system call registers resources (e.g. user buffers, files, eventfd,
|
23
|
+
personality, restrictions) for use in an
|
24
|
+
.BR io_uring (7)
|
25
|
+
instance referenced by
|
26
|
+
.IR fd .
|
27
|
+
Registering files or user buffers allows the kernel to take long term
|
28
|
+
references to internal data structures or create long term mappings of
|
29
|
+
application memory, greatly reducing per-I/O overhead.
|
30
|
+
|
31
|
+
.I fd
|
32
|
+
is the file descriptor returned by a call to
|
33
|
+
.BR io_uring_setup (2).
|
34
|
+
.I opcode
|
35
|
+
can be one of:
|
36
|
+
|
37
|
+
.TP
|
38
|
+
.B IORING_REGISTER_BUFFERS
|
39
|
+
.I arg
|
40
|
+
points to a
|
41
|
+
.I struct iovec
|
42
|
+
array of
|
43
|
+
.I nr_args
|
44
|
+
entries. The buffers associated with the iovecs will be locked in
|
45
|
+
memory and charged against the user's
|
46
|
+
.B RLIMIT_MEMLOCK
|
47
|
+
resource limit. See
|
48
|
+
.BR getrlimit (2)
|
49
|
+
for more information. Additionally, there is a size limit of 1GiB per
|
50
|
+
buffer. Currently, the buffers must be anonymous, non-file-backed
|
51
|
+
memory, such as that returned by
|
52
|
+
.BR malloc (3)
|
53
|
+
or
|
54
|
+
.BR mmap (2)
|
55
|
+
with the
|
56
|
+
.B MAP_ANONYMOUS
|
57
|
+
flag set. It is expected that this limitation will be lifted in the
|
58
|
+
future. Huge pages are supported as well. Note that the entire huge
|
59
|
+
page will be pinned in the kernel, even if only a portion of it is
|
60
|
+
used.
|
61
|
+
|
62
|
+
After a successful call, the supplied buffers are mapped into the
|
63
|
+
kernel and eligible for I/O. To make use of them, the application
|
64
|
+
must specify the
|
65
|
+
.B IORING_OP_READ_FIXED
|
66
|
+
or
|
67
|
+
.B IORING_OP_WRITE_FIXED
|
68
|
+
opcodes in the submission queue entry (see the
|
69
|
+
.I struct io_uring_sqe
|
70
|
+
definition in
|
71
|
+
.BR io_uring_enter (2)),
|
72
|
+
and set the
|
73
|
+
.I buf_index
|
74
|
+
field to the desired buffer index. The memory range described by the
|
75
|
+
submission queue entry's
|
76
|
+
.I addr
|
77
|
+
and
|
78
|
+
.I len
|
79
|
+
fields must fall within the indexed buffer.
|
80
|
+
|
81
|
+
It is perfectly valid to setup a large buffer and then only use part
|
82
|
+
of it for an I/O, as long as the range is within the originally mapped
|
83
|
+
region.
|
84
|
+
|
85
|
+
An application can increase or decrease the size or number of
|
86
|
+
registered buffers by first unregistering the existing buffers, and
|
87
|
+
then issuing a new call to
|
88
|
+
.BR io_uring_register ()
|
89
|
+
with the new buffers.
|
90
|
+
|
91
|
+
Note that before 5.13 registering buffers would wait for the ring to idle.
|
92
|
+
If the application currently has requests in-flight, the registration will
|
93
|
+
wait for those to finish before proceeding.
|
94
|
+
|
95
|
+
An application need not unregister buffers explicitly before shutting
|
96
|
+
down the io_uring instance. Available since 5.1.
|
97
|
+
|
98
|
+
.TP
|
99
|
+
.B IORING_REGISTER_BUFFERS2
|
100
|
+
Register buffers for I/O. Similar to
|
101
|
+
.B IORING_REGISTER_BUFFERS
|
102
|
+
but aims to have a more extensible ABI.
|
103
|
+
|
104
|
+
.I arg
|
105
|
+
points to a
|
106
|
+
.I struct io_uring_rsrc_register,
|
107
|
+
and
|
108
|
+
.I nr_args
|
109
|
+
should be set to the number of bytes in the structure.
|
110
|
+
|
111
|
+
.PP
|
112
|
+
.in +8n
|
113
|
+
.EX
|
114
|
+
struct io_uring_rsrc_register {
|
115
|
+
__u32 nr;
|
116
|
+
__u32 resv;
|
117
|
+
__u64 resv2;
|
118
|
+
__aligned_u64 data;
|
119
|
+
__aligned_u64 tags;
|
120
|
+
};
|
121
|
+
|
122
|
+
.EE
|
123
|
+
.in
|
124
|
+
.PP
|
125
|
+
|
126
|
+
.in +8n
|
127
|
+
|
128
|
+
The
|
129
|
+
.I data
|
130
|
+
field contains a pointer to a
|
131
|
+
.I struct iovec
|
132
|
+
array of
|
133
|
+
.I nr
|
134
|
+
entries.
|
135
|
+
The
|
136
|
+
.I tags
|
137
|
+
field should either be 0, then tagging is disabled, or point to an array
|
138
|
+
of
|
139
|
+
.I nr
|
140
|
+
"tags" (unsigned 64 bit integers). If a tag is zero, then tagging for this
|
141
|
+
particular resource (a buffer in this case) is disabled. Otherwise, after the
|
142
|
+
resource had been unregistered and it's not used anymore, a CQE will be
|
143
|
+
posted with
|
144
|
+
.I user_data
|
145
|
+
set to the specified tag and all other fields zeroed.
|
146
|
+
|
147
|
+
Note that resource updates, e.g.
|
148
|
+
.B IORING_REGISTER_BUFFERS_UPDATE,
|
149
|
+
don't necessarily deallocate resources by the time it returns, but they might
|
150
|
+
be held alive until all requests using it complete.
|
151
|
+
|
152
|
+
Available since 5.13.
|
153
|
+
|
154
|
+
.TP
|
155
|
+
.B IORING_REGISTER_BUFFERS_UPDATE
|
156
|
+
Updates registered buffers with new ones, either turning a sparse entry into
|
157
|
+
a real one, or replacing an existing entry.
|
158
|
+
|
159
|
+
.I arg
|
160
|
+
must contain a pointer to a struct io_uring_rsrc_update2, which contains
|
161
|
+
an offset on which to start the update, and an array of
|
162
|
+
.I struct iovec.
|
163
|
+
.I tags
|
164
|
+
points to an array of tags.
|
165
|
+
.I nr
|
166
|
+
must contain the number of descriptors in the passed in arrays.
|
167
|
+
See
|
168
|
+
.B IORING_REGISTER_BUFFERS2
|
169
|
+
for the resource tagging description.
|
170
|
+
|
171
|
+
.PP
|
172
|
+
.in +8n
|
173
|
+
.EX
|
174
|
+
|
175
|
+
struct io_uring_rsrc_update2 {
|
176
|
+
__u32 offset;
|
177
|
+
__u32 resv;
|
178
|
+
__aligned_u64 data;
|
179
|
+
__aligned_u64 tags;
|
180
|
+
__u32 nr;
|
181
|
+
__u32 resv2;
|
182
|
+
};
|
183
|
+
.EE
|
184
|
+
.in
|
185
|
+
.PP
|
186
|
+
|
187
|
+
.in +8n
|
188
|
+
|
189
|
+
Available since 5.13.
|
190
|
+
|
191
|
+
.TP
|
192
|
+
.B IORING_UNREGISTER_BUFFERS
|
193
|
+
This operation takes no argument, and
|
194
|
+
.I arg
|
195
|
+
must be passed as NULL. All previously registered buffers associated
|
196
|
+
with the io_uring instance will be released. Available since 5.1.
|
197
|
+
|
198
|
+
.TP
|
199
|
+
.B IORING_REGISTER_FILES
|
200
|
+
Register files for I/O.
|
201
|
+
.I arg
|
202
|
+
contains a pointer to an array of
|
203
|
+
.I nr_args
|
204
|
+
file descriptors (signed 32 bit integers).
|
205
|
+
|
206
|
+
To make use of the registered files, the
|
207
|
+
.B IOSQE_FIXED_FILE
|
208
|
+
flag must be set in the
|
209
|
+
.I flags
|
210
|
+
member of the
|
211
|
+
.IR "struct io_uring_sqe" ,
|
212
|
+
and the
|
213
|
+
.I fd
|
214
|
+
member is set to the index of the file in the file descriptor array.
|
215
|
+
|
216
|
+
The file set may be sparse, meaning that the
|
217
|
+
.B fd
|
218
|
+
field in the array may be set to
|
219
|
+
.B -1.
|
220
|
+
See
|
221
|
+
.B IORING_REGISTER_FILES_UPDATE
|
222
|
+
for how to update files in place.
|
223
|
+
|
224
|
+
Note that before 5.13 registering files would wait for the ring to idle.
|
225
|
+
If the application currently has requests in-flight, the registration will
|
226
|
+
wait for those to finish before proceeding. See
|
227
|
+
.B IORING_REGISTER_FILES_UPDATE
|
228
|
+
for how to update an existing set without that limitation.
|
229
|
+
|
230
|
+
Files are automatically unregistered when the io_uring instance is
|
231
|
+
torn down. An application needs only unregister if it wishes to
|
232
|
+
register a new set of fds. Available since 5.1.
|
233
|
+
|
234
|
+
.TP
|
235
|
+
.B IORING_REGISTER_FILES2
|
236
|
+
Register files for I/O. Similar to
|
237
|
+
.B IORING_REGISTER_FILES.
|
238
|
+
|
239
|
+
.I arg
|
240
|
+
points to a
|
241
|
+
.I struct io_uring_rsrc_register,
|
242
|
+
and
|
243
|
+
.I nr_args
|
244
|
+
should be set to the number of bytes in the structure.
|
245
|
+
|
246
|
+
The
|
247
|
+
.I data
|
248
|
+
field contains a pointer to an array of
|
249
|
+
.I nr
|
250
|
+
file descriptors (signed 32 bit integers).
|
251
|
+
.I tags
|
252
|
+
field should either be 0 or or point to an array of
|
253
|
+
.I nr
|
254
|
+
"tags" (unsigned 64 bit integers). See
|
255
|
+
.B IORING_REGISTER_BUFFERS2
|
256
|
+
for more info on resource tagging.
|
257
|
+
|
258
|
+
Note that resource updates, e.g.
|
259
|
+
.B IORING_REGISTER_FILES_UPDATE,
|
260
|
+
don't necessarily deallocate resources, they might be held until all requests
|
261
|
+
using that resource complete.
|
262
|
+
|
263
|
+
Available since 5.13.
|
264
|
+
|
265
|
+
.TP
|
266
|
+
.B IORING_REGISTER_FILES_UPDATE
|
267
|
+
This operation replaces existing files in the registered file set with new
|
268
|
+
ones, either turning a sparse entry (one where fd is equal to
|
269
|
+
.B -1
|
270
|
+
) into a real one, removing an existing entry (new one is set to
|
271
|
+
.B -1
|
272
|
+
), or replacing an existing entry with a new existing entry.
|
273
|
+
|
274
|
+
.I arg
|
275
|
+
must contain a pointer to a
|
276
|
+
.I struct io_uring_files_update,
|
277
|
+
which contains
|
278
|
+
an offset on which to start the update, and an array of file descriptors to
|
279
|
+
use for the update.
|
280
|
+
.I nr_args
|
281
|
+
must contain the number of descriptors in the passed in array. Available
|
282
|
+
since 5.5.
|
283
|
+
|
284
|
+
File descriptors can be skipped if they are set to
|
285
|
+
.B IORING_REGISTER_FILES_SKIP.
|
286
|
+
Skipping an fd will not touch the file associated with the previous
|
287
|
+
fd at that index. Available since 5.12.
|
288
|
+
|
289
|
+
.TP
|
290
|
+
.B IORING_REGISTER_FILES_UPDATE2
|
291
|
+
Similar to IORING_REGISTER_FILES_UPDATE, replaces existing files in the
|
292
|
+
registered file set with new ones, either turning a sparse entry (one where
|
293
|
+
fd is equal to
|
294
|
+
.B -1
|
295
|
+
) into a real one, removing an existing entry (new one is set to
|
296
|
+
.B -1
|
297
|
+
), or replacing an existing entry with a new existing entry.
|
298
|
+
|
299
|
+
.I arg
|
300
|
+
must contain a pointer to a
|
301
|
+
.I struct io_uring_rsrc_update2,
|
302
|
+
which contains
|
303
|
+
an offset on which to start the update, and an array of file descriptors to
|
304
|
+
use for the update stored in
|
305
|
+
.I data.
|
306
|
+
.I tags
|
307
|
+
points to an array of tags.
|
308
|
+
.I nr
|
309
|
+
must contain the number of descriptors in the passed in arrays.
|
310
|
+
See
|
311
|
+
.B IORING_REGISTER_BUFFERS2
|
312
|
+
for the resource tagging description.
|
313
|
+
|
314
|
+
Available since 5.13.
|
315
|
+
|
316
|
+
.TP
|
317
|
+
.B IORING_UNREGISTER_FILES
|
318
|
+
This operation requires no argument, and
|
319
|
+
.I arg
|
320
|
+
must be passed as NULL. All previously registered files associated
|
321
|
+
with the io_uring instance will be unregistered. Available since 5.1.
|
322
|
+
|
323
|
+
.TP
|
324
|
+
.B IORING_REGISTER_EVENTFD
|
325
|
+
It's possible to use eventfd(2) to get notified of completion events on an
|
326
|
+
io_uring instance. If this is desired, an eventfd file descriptor can be
|
327
|
+
registered through this operation.
|
328
|
+
.I arg
|
329
|
+
must contain a pointer to the eventfd file descriptor, and
|
330
|
+
.I nr_args
|
331
|
+
must be 1. Available since 5.2.
|
332
|
+
|
333
|
+
An application can temporarily disable notifications, coming through the
|
334
|
+
registered eventfd, by setting the
|
335
|
+
.B IORING_CQ_EVENTFD_DISABLED
|
336
|
+
bit in the
|
337
|
+
.I flags
|
338
|
+
field of the CQ ring.
|
339
|
+
Available since 5.8.
|
340
|
+
|
341
|
+
.TP
|
342
|
+
.B IORING_REGISTER_EVENTFD_ASYNC
|
343
|
+
This works just like
|
344
|
+
.B IORING_REGISTER_EVENTFD
|
345
|
+
, except notifications are only posted for events that complete in an async
|
346
|
+
manner. This means that events that complete inline while being submitted
|
347
|
+
do not trigger a notification event. The arguments supplied are the same as
|
348
|
+
for
|
349
|
+
.B IORING_REGISTER_EVENTFD.
|
350
|
+
Available since 5.6.
|
351
|
+
|
352
|
+
.TP
|
353
|
+
.B IORING_UNREGISTER_EVENTFD
|
354
|
+
Unregister an eventfd file descriptor to stop notifications. Since only one
|
355
|
+
eventfd descriptor is currently supported, this operation takes no argument,
|
356
|
+
and
|
357
|
+
.I arg
|
358
|
+
must be passed as NULL and
|
359
|
+
.I nr_args
|
360
|
+
must be zero. Available since 5.2.
|
361
|
+
|
362
|
+
.TP
|
363
|
+
.B IORING_REGISTER_PROBE
|
364
|
+
This operation returns a structure, io_uring_probe, which contains information
|
365
|
+
about the opcodes supported by io_uring on the running kernel.
|
366
|
+
.I arg
|
367
|
+
must contain a pointer to a struct io_uring_probe, and
|
368
|
+
.I nr_args
|
369
|
+
must contain the size of the ops array in that probe struct. The ops array
|
370
|
+
is of the type io_uring_probe_op, which holds the value of the opcode and
|
371
|
+
a flags field. If the flags field has
|
372
|
+
.B IO_URING_OP_SUPPORTED
|
373
|
+
set, then this opcode is supported on the running kernel. Available since 5.6.
|
374
|
+
|
375
|
+
.TP
|
376
|
+
.B IORING_REGISTER_PERSONALITY
|
377
|
+
This operation registers credentials of the running application with io_uring,
|
378
|
+
and returns an id associated with these credentials. Applications wishing to
|
379
|
+
share a ring between separate users/processes can pass in this credential id
|
380
|
+
in the sqe
|
381
|
+
.B personality
|
382
|
+
field. If set, that particular sqe will be issued with these credentials. Must
|
383
|
+
be invoked with
|
384
|
+
.I arg
|
385
|
+
set to NULL and
|
386
|
+
.I nr_args
|
387
|
+
set to zero. Available since 5.6.
|
388
|
+
|
389
|
+
.TP
|
390
|
+
.B IORING_UNREGISTER_PERSONALITY
|
391
|
+
This operation unregisters a previously registered personality with io_uring.
|
392
|
+
.I nr_args
|
393
|
+
must be set to the id in question, and
|
394
|
+
.I arg
|
395
|
+
must be set to NULL. Available since 5.6.
|
396
|
+
|
397
|
+
.TP
|
398
|
+
.B IORING_REGISTER_ENABLE_RINGS
|
399
|
+
This operation enables an io_uring ring started in a disabled state
|
400
|
+
.RB (IORING_SETUP_R_DISABLED
|
401
|
+
was specified in the call to
|
402
|
+
.BR io_uring_setup (2)).
|
403
|
+
While the io_uring ring is disabled, submissions are not allowed and
|
404
|
+
registrations are not restricted.
|
405
|
+
|
406
|
+
After the execution of this operation, the io_uring ring is enabled:
|
407
|
+
submissions and registration are allowed, but they will
|
408
|
+
be validated following the registered restrictions (if any).
|
409
|
+
This operation takes no argument, must be invoked with
|
410
|
+
.I arg
|
411
|
+
set to NULL and
|
412
|
+
.I nr_args
|
413
|
+
set to zero. Available since 5.10.
|
414
|
+
|
415
|
+
.TP
|
416
|
+
.B IORING_REGISTER_RESTRICTIONS
|
417
|
+
.I arg
|
418
|
+
points to a
|
419
|
+
.I struct io_uring_restriction
|
420
|
+
array of
|
421
|
+
.I nr_args
|
422
|
+
entries.
|
423
|
+
|
424
|
+
With an entry it is possible to allow an
|
425
|
+
.BR io_uring_register ()
|
426
|
+
.I opcode,
|
427
|
+
or specify which
|
428
|
+
.I opcode
|
429
|
+
and
|
430
|
+
.I flags
|
431
|
+
of the submission queue entry are allowed,
|
432
|
+
or require certain
|
433
|
+
.I flags
|
434
|
+
to be specified (these flags must be set on each submission queue entry).
|
435
|
+
|
436
|
+
All the restrictions must be submitted with a single
|
437
|
+
.BR io_uring_register ()
|
438
|
+
call and they are handled as an allowlist (opcodes and flags not registered,
|
439
|
+
are not allowed).
|
440
|
+
|
441
|
+
Restrictions can be registered only if the io_uring ring started in a disabled
|
442
|
+
state
|
443
|
+
.RB (IORING_SETUP_R_DISABLED
|
444
|
+
must be specified in the call to
|
445
|
+
.BR io_uring_setup (2)).
|
446
|
+
|
447
|
+
Available since 5.10.
|
448
|
+
|
449
|
+
.TP
|
450
|
+
.B IORING_REGISTER_IOWQ_AFF
|
451
|
+
By default, async workers created by io_uring will inherit the CPU mask of its
|
452
|
+
parent. This is usually all the CPUs in the system, unless the parent is being
|
453
|
+
run with a limited set. If this isn't the desired outcome, the application
|
454
|
+
may explicitly tell io_uring what CPUs the async workers may run on.
|
455
|
+
.I arg
|
456
|
+
must point to a
|
457
|
+
.B cpu_set_t
|
458
|
+
mask, and
|
459
|
+
.I nr_args
|
460
|
+
the byte size of that mask.
|
461
|
+
|
462
|
+
Available since 5.14.
|
463
|
+
|
464
|
+
.TP
|
465
|
+
.B IORING_UNREGISTER_IOWQ_AFF
|
466
|
+
Undoes a CPU mask previously set with
|
467
|
+
.B IORING_REGISTER_IOWQ_AFF.
|
468
|
+
Must not have
|
469
|
+
.I arg
|
470
|
+
or
|
471
|
+
.I nr_args
|
472
|
+
set.
|
473
|
+
|
474
|
+
Available since 5.14.
|
475
|
+
|
476
|
+
.TP
|
477
|
+
.B IORING_REGISTER_IOWQ_MAX_WORKERS
|
478
|
+
By default, io_uring limits the unbounded workers created to the maximum
|
479
|
+
processor count set by
|
480
|
+
.I RLIMIT_NPROC
|
481
|
+
and the bounded workers is a function of the SQ ring size and the number
|
482
|
+
of CPUs in the system. Sometimes this can be excessive (or too little, for
|
483
|
+
bounded), and this command provides a way to change the count per ring (per NUMA
|
484
|
+
node) instead.
|
485
|
+
|
486
|
+
.I arg
|
487
|
+
must be set to an
|
488
|
+
.I unsigned int
|
489
|
+
pointer to an array of two values, with the values in the array being set to
|
490
|
+
the maximum count of workers per NUMA node. Index 0 holds the bounded worker
|
491
|
+
count, and index 1 holds the unbounded worker count. On successful return, the
|
492
|
+
passed in array will contain the previous maximum valyes for each type. If the
|
493
|
+
count being passed in is 0, then this command returns the current maximum values
|
494
|
+
and doesn't modify the current setting.
|
495
|
+
.I nr_args
|
496
|
+
must be set to 2, as the command takes two values.
|
497
|
+
|
498
|
+
Available since 5.15.
|
499
|
+
|
500
|
+
.TP
|
501
|
+
.B IORING_REGISTER_RING_FDS
|
502
|
+
Whenever
|
503
|
+
.BR io_uring_enter (2)
|
504
|
+
is called to submit request or wait for completions, the kernel must grab a
|
505
|
+
reference to the file descriptor. If the application using io_uring is threaded,
|
506
|
+
the file table is marked as shared, and the reference grab and put of the file
|
507
|
+
descriptor count is more expensive than it is for a non-threaded application.
|
508
|
+
|
509
|
+
Similarly to how io_uring allows registration of files, this allow registration
|
510
|
+
of the ring file descriptor itself. This reduces the overhead of the
|
511
|
+
.BR io_uring_enter (2)
|
512
|
+
system call.
|
513
|
+
|
514
|
+
.I arg
|
515
|
+
must be set to an unsigned int pointer to an array of type
|
516
|
+
.I struct io_uring_rsrc_register
|
517
|
+
of
|
518
|
+
.I nr_args
|
519
|
+
number of entries. The
|
520
|
+
.B data
|
521
|
+
field of this struct must point to an io_uring file descriptor, and the
|
522
|
+
.B offset
|
523
|
+
field can be either
|
524
|
+
.B -1
|
525
|
+
or an explicit offset desired for the registered file descriptor value. If
|
526
|
+
.B -1
|
527
|
+
is used, then upon successful return of this system call, the field will
|
528
|
+
contain the value of the registered file descriptor to be used for future
|
529
|
+
.BR io_uring_enter (2)
|
530
|
+
system calls.
|
531
|
+
|
532
|
+
On successful completion of this request, the returned descriptors may be used
|
533
|
+
instead of the real file descriptor for
|
534
|
+
.BR io_uring_enter (2),
|
535
|
+
provided that
|
536
|
+
.B IORING_ENTER_REGISTERED_RING
|
537
|
+
is set in the
|
538
|
+
.I flags
|
539
|
+
for the system call. This flag tells the kernel that a registered descriptor
|
540
|
+
is used rather than a real file descriptor.
|
541
|
+
|
542
|
+
Each thread or process using a ring must register the file descriptor directly
|
543
|
+
by issuing this request.o
|
544
|
+
|
545
|
+
The maximum number of supported registered ring descriptors is currently
|
546
|
+
limited to
|
547
|
+
.B 16.
|
548
|
+
|
549
|
+
Available since 5.18.
|
550
|
+
|
551
|
+
.TP
|
552
|
+
.B IORING_UNREGISTER_RING_FDS
|
553
|
+
Unregister descriptors previously registered with
|
554
|
+
.B IORING_REGISTER_RING_FDS.
|
555
|
+
|
556
|
+
.I arg
|
557
|
+
must be set to an unsigned int pointer to an array of type
|
558
|
+
.I struct io_uring_rsrc_register
|
559
|
+
of
|
560
|
+
.I nr_args
|
561
|
+
number of entries. Only the
|
562
|
+
.B offset
|
563
|
+
field should be set in the structure, containing the registered file descriptor
|
564
|
+
offset previously returned from
|
565
|
+
.B IORING_REGISTER_RING_FDS
|
566
|
+
that the application wishes to unregister.
|
567
|
+
|
568
|
+
Note that this isn't done automatically on ring exit, if the thread or task
|
569
|
+
that previously registered a ring file descriptor isn't exiting. It is
|
570
|
+
recommended to manually unregister any previously registered ring descriptors
|
571
|
+
if the ring is closed and the task persists. This will free up a registration
|
572
|
+
slot, making it available for future use.
|
573
|
+
|
574
|
+
Available since 5.18.
|
575
|
+
|
576
|
+
.SH RETURN VALUE
|
577
|
+
|
578
|
+
On success,
|
579
|
+
.BR io_uring_register ()
|
580
|
+
returns 0. On error,
|
581
|
+
.B -1
|
582
|
+
is returned, and
|
583
|
+
.I errno
|
584
|
+
is set accordingly.
|
585
|
+
|
586
|
+
.SH ERRORS
|
587
|
+
.TP
|
588
|
+
.B EACCES
|
589
|
+
The
|
590
|
+
.I opcode
|
591
|
+
field is not allowed due to registered restrictions.
|
592
|
+
.TP
|
593
|
+
.B EBADF
|
594
|
+
One or more fds in the
|
595
|
+
.I fd
|
596
|
+
array are invalid.
|
597
|
+
.TP
|
598
|
+
.B EBADFD
|
599
|
+
.B IORING_REGISTER_ENABLE_RINGS
|
600
|
+
or
|
601
|
+
.B IORING_REGISTER_RESTRICTIONS
|
602
|
+
was specified, but the io_uring ring is not disabled.
|
603
|
+
.TP
|
604
|
+
.B EBUSY
|
605
|
+
.B IORING_REGISTER_BUFFERS
|
606
|
+
or
|
607
|
+
.B IORING_REGISTER_FILES
|
608
|
+
or
|
609
|
+
.B IORING_REGISTER_RESTRICTIONS
|
610
|
+
was specified, but there were already buffers, files, or restrictions
|
611
|
+
registered.
|
612
|
+
.TP
|
613
|
+
.B EFAULT
|
614
|
+
buffer is outside of the process' accessible address space, or
|
615
|
+
.I iov_len
|
616
|
+
is greater than 1GiB.
|
617
|
+
.TP
|
618
|
+
.B EINVAL
|
619
|
+
.B IORING_REGISTER_BUFFERS
|
620
|
+
or
|
621
|
+
.B IORING_REGISTER_FILES
|
622
|
+
was specified, but
|
623
|
+
.I nr_args
|
624
|
+
is 0.
|
625
|
+
.TP
|
626
|
+
.B EINVAL
|
627
|
+
.B IORING_REGISTER_BUFFERS
|
628
|
+
was specified, but
|
629
|
+
.I nr_args
|
630
|
+
exceeds
|
631
|
+
.B UIO_MAXIOV
|
632
|
+
.TP
|
633
|
+
.B EINVAL
|
634
|
+
.B IORING_UNREGISTER_BUFFERS
|
635
|
+
or
|
636
|
+
.B IORING_UNREGISTER_FILES
|
637
|
+
was specified, and
|
638
|
+
.I nr_args
|
639
|
+
is non-zero or
|
640
|
+
.I arg
|
641
|
+
is non-NULL.
|
642
|
+
.TP
|
643
|
+
.B EINVAL
|
644
|
+
.B IORING_REGISTER_RESTRICTIONS
|
645
|
+
was specified, but
|
646
|
+
.I nr_args
|
647
|
+
exceeds the maximum allowed number of restrictions or restriction
|
648
|
+
.I opcode
|
649
|
+
is invalid.
|
650
|
+
.TP
|
651
|
+
.B EMFILE
|
652
|
+
.B IORING_REGISTER_FILES
|
653
|
+
was specified and
|
654
|
+
.I nr_args
|
655
|
+
exceeds the maximum allowed number of files in a fixed file set.
|
656
|
+
.TP
|
657
|
+
.B EMFILE
|
658
|
+
.B IORING_REGISTER_FILES
|
659
|
+
was specified and adding
|
660
|
+
.I nr_args
|
661
|
+
file references would exceed the maximum allowed number of files the user
|
662
|
+
is allowed to have according to the
|
663
|
+
.B
|
664
|
+
RLIMIT_NOFILE
|
665
|
+
resource limit and the caller does not have
|
666
|
+
.B CAP_SYS_RESOURCE
|
667
|
+
capability. Note that this is a per user limit, not per process.
|
668
|
+
.TP
|
669
|
+
.B ENOMEM
|
670
|
+
Insufficient kernel resources are available, or the caller had a
|
671
|
+
non-zero
|
672
|
+
.B RLIMIT_MEMLOCK
|
673
|
+
soft resource limit, but tried to lock more memory than the limit
|
674
|
+
permitted. This limit is not enforced if the process is privileged
|
675
|
+
.RB ( CAP_IPC_LOCK ).
|
676
|
+
.TP
|
677
|
+
.B ENXIO
|
678
|
+
.B IORING_UNREGISTER_BUFFERS
|
679
|
+
or
|
680
|
+
.B IORING_UNREGISTER_FILES
|
681
|
+
was specified, but there were no buffers or files registered.
|
682
|
+
.TP
|
683
|
+
.B ENXIO
|
684
|
+
Attempt to register files or buffers on an io_uring instance that is already
|
685
|
+
undergoing file or buffer registration, or is being torn down.
|
686
|
+
.TP
|
687
|
+
.B EOPNOTSUPP
|
688
|
+
User buffers point to file-backed memory.
|