polyphony 0.93 → 0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -2
- data/.gitignore +3 -3
- data/CHANGELOG.md +14 -0
- data/docs/api-reference/fiber.md +2 -2
- data/docs/api-reference/object.md +3 -3
- data/docs/main-concepts/exception-handling.md +2 -2
- data/examples/pipes/echo_server.rb +1 -1
- data/examples/pipes/http_server.rb +33 -0
- data/ext/polyphony/backend_common.c +53 -8
- data/ext/polyphony/backend_common.h +21 -13
- data/ext/polyphony/backend_io_uring.c +85 -147
- data/ext/polyphony/backend_libev.c +58 -89
- data/ext/polyphony/event.c +1 -1
- data/ext/polyphony/extconf.rb +7 -5
- data/ext/polyphony/fiber.c +5 -13
- data/ext/polyphony/io_extensions.c +68 -68
- data/ext/polyphony/pipe.c +1 -1
- data/ext/polyphony/polyphony.c +23 -23
- data/ext/polyphony/polyphony.h +0 -9
- data/ext/polyphony/polyphony_ext.c +1 -1
- data/ext/polyphony/queue.c +1 -1
- data/ext/polyphony/ring_buffer.c +1 -0
- data/ext/polyphony/socket_extensions.c +1 -1
- data/ext/polyphony/thread.c +1 -1
- data/lib/polyphony/extensions/enumerator.rb +16 -0
- data/lib/polyphony/extensions/socket.rb +2 -0
- data/lib/polyphony/extensions.rb +1 -0
- data/lib/polyphony/version.rb +1 -1
- data/polyphony.gemspec +2 -2
- data/test/test_backend.rb +5 -1
- data/test/test_enumerator.rb +46 -0
- data/test/test_global_api.rb +1 -1
- data/test/test_io.rb +241 -216
- data/test/test_socket.rb +1 -1
- data/test/test_thread_pool.rb +3 -3
- data/vendor/liburing/.github/workflows/build.yml +51 -5
- data/vendor/liburing/.github/workflows/shellcheck.yml +1 -1
- data/vendor/liburing/.gitignore +6 -123
- data/vendor/liburing/CHANGELOG +35 -0
- data/vendor/liburing/CITATION.cff +11 -0
- data/vendor/liburing/LICENSE +16 -3
- data/vendor/liburing/Makefile +3 -1
- data/vendor/liburing/Makefile.common +1 -0
- data/vendor/liburing/README +14 -2
- data/vendor/liburing/SECURITY.md +6 -0
- data/vendor/liburing/configure +16 -15
- data/vendor/liburing/examples/Makefile +4 -1
- data/vendor/liburing/examples/io_uring-udp.c +395 -0
- data/vendor/liburing/examples/poll-bench.c +101 -0
- data/vendor/liburing/examples/send-zerocopy.c +339 -0
- data/vendor/liburing/liburing.spec +1 -1
- data/vendor/liburing/man/io_uring.7 +38 -11
- data/vendor/liburing/man/io_uring_buf_ring_add.3 +53 -0
- data/vendor/liburing/man/io_uring_buf_ring_advance.3 +31 -0
- data/vendor/liburing/man/io_uring_buf_ring_cq_advance.3 +41 -0
- data/vendor/liburing/man/io_uring_buf_ring_init.3 +30 -0
- data/vendor/liburing/man/io_uring_buf_ring_mask.3 +27 -0
- data/vendor/liburing/man/io_uring_cq_advance.3 +29 -15
- data/vendor/liburing/man/io_uring_cq_has_overflow.3 +25 -0
- data/vendor/liburing/man/io_uring_cq_ready.3 +9 -8
- data/vendor/liburing/man/io_uring_cqe_get_data.3 +32 -13
- data/vendor/liburing/man/io_uring_cqe_get_data64.3 +1 -0
- data/vendor/liburing/man/io_uring_cqe_seen.3 +22 -12
- data/vendor/liburing/man/io_uring_enter.2 +249 -32
- data/vendor/liburing/man/io_uring_enter2.2 +1 -0
- data/vendor/liburing/man/io_uring_free_probe.3 +11 -8
- data/vendor/liburing/man/io_uring_get_events.3 +33 -0
- data/vendor/liburing/man/io_uring_get_probe.3 +9 -8
- data/vendor/liburing/man/io_uring_get_sqe.3 +29 -10
- data/vendor/liburing/man/io_uring_opcode_supported.3 +11 -10
- data/vendor/liburing/man/io_uring_peek_cqe.3 +38 -0
- data/vendor/liburing/man/io_uring_prep_accept.3 +197 -0
- data/vendor/liburing/man/io_uring_prep_accept_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_cancel.3 +118 -0
- data/vendor/liburing/man/io_uring_prep_cancel64.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_close.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_close_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_connect.3 +66 -0
- data/vendor/liburing/man/io_uring_prep_fadvise.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_fallocate.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_files_update.3 +92 -0
- data/vendor/liburing/man/io_uring_prep_fsync.3 +70 -0
- data/vendor/liburing/man/io_uring_prep_link.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_linkat.3 +91 -0
- data/vendor/liburing/man/io_uring_prep_madvise.3 +56 -0
- data/vendor/liburing/man/io_uring_prep_mkdir.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_mkdirat.3 +83 -0
- data/vendor/liburing/man/io_uring_prep_msg_ring.3 +39 -25
- data/vendor/liburing/man/io_uring_prep_multishot_accept.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_multishot_accept_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_nop.3 +28 -0
- data/vendor/liburing/man/io_uring_prep_openat.3 +117 -0
- data/vendor/liburing/man/io_uring_prep_openat2.3 +117 -0
- data/vendor/liburing/man/io_uring_prep_openat2_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_openat_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_poll_add.3 +72 -0
- data/vendor/liburing/man/io_uring_prep_poll_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_poll_remove.3 +55 -0
- data/vendor/liburing/man/io_uring_prep_poll_update.3 +89 -0
- data/vendor/liburing/man/io_uring_prep_provide_buffers.3 +131 -0
- data/vendor/liburing/man/io_uring_prep_read.3 +33 -14
- data/vendor/liburing/man/io_uring_prep_read_fixed.3 +39 -21
- data/vendor/liburing/man/io_uring_prep_readv.3 +49 -15
- data/vendor/liburing/man/io_uring_prep_readv2.3 +49 -17
- data/vendor/liburing/man/io_uring_prep_recv.3 +105 -0
- data/vendor/liburing/man/io_uring_prep_recv_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_recvmsg.3 +124 -0
- data/vendor/liburing/man/io_uring_prep_recvmsg_multishot.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_remove_buffers.3 +52 -0
- data/vendor/liburing/man/io_uring_prep_rename.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_renameat.3 +96 -0
- data/vendor/liburing/man/io_uring_prep_send.3 +57 -0
- data/vendor/liburing/man/io_uring_prep_send_zc.3 +64 -0
- data/vendor/liburing/man/io_uring_prep_sendmsg.3 +69 -0
- data/vendor/liburing/man/io_uring_prep_shutdown.3 +53 -0
- data/vendor/liburing/man/io_uring_prep_socket.3 +118 -0
- data/vendor/liburing/man/io_uring_prep_socket_direct.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_socket_direct_alloc.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_splice.3 +80 -0
- data/vendor/liburing/man/io_uring_prep_statx.3 +74 -0
- data/vendor/liburing/man/io_uring_prep_symlink.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_symlinkat.3 +85 -0
- data/vendor/liburing/man/io_uring_prep_sync_file_range.3 +59 -0
- data/vendor/liburing/man/io_uring_prep_tee.3 +74 -0
- data/vendor/liburing/man/io_uring_prep_timeout.3 +95 -0
- data/vendor/liburing/man/io_uring_prep_timeout_remove.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_timeout_update.3 +98 -0
- data/vendor/liburing/man/io_uring_prep_unlink.3 +1 -0
- data/vendor/liburing/man/io_uring_prep_unlinkat.3 +82 -0
- data/vendor/liburing/man/io_uring_prep_write.3 +32 -15
- data/vendor/liburing/man/io_uring_prep_write_fixed.3 +39 -21
- data/vendor/liburing/man/io_uring_prep_writev.3 +50 -16
- data/vendor/liburing/man/io_uring_prep_writev2.3 +50 -17
- data/vendor/liburing/man/io_uring_queue_exit.3 +3 -4
- data/vendor/liburing/man/io_uring_queue_init.3 +58 -13
- data/vendor/liburing/man/io_uring_queue_init_params.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_cmsg_firsthdr.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_cmsg_nexthdr.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_name.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_out.3 +78 -0
- data/vendor/liburing/man/io_uring_recvmsg_payload.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_payload_length.3 +1 -0
- data/vendor/liburing/man/io_uring_recvmsg_validate.3 +1 -0
- data/vendor/liburing/man/io_uring_register.2 +153 -13
- data/vendor/liburing/man/io_uring_register_buf_ring.3 +140 -0
- data/vendor/liburing/man/io_uring_register_buffers.3 +32 -12
- data/vendor/liburing/man/io_uring_register_eventfd.3 +51 -0
- data/vendor/liburing/man/io_uring_register_eventfd_async.3 +1 -0
- data/vendor/liburing/man/io_uring_register_file_alloc_range.3 +52 -0
- data/vendor/liburing/man/io_uring_register_files.3 +33 -11
- data/vendor/liburing/man/io_uring_register_files_sparse.3 +1 -0
- data/vendor/liburing/man/io_uring_register_iowq_aff.3 +61 -0
- data/vendor/liburing/man/io_uring_register_iowq_max_workers.3 +71 -0
- data/vendor/liburing/man/io_uring_register_ring_fd.3 +49 -0
- data/vendor/liburing/man/io_uring_register_sync_cancel.3 +71 -0
- data/vendor/liburing/man/io_uring_setup.2 +119 -13
- data/vendor/liburing/man/io_uring_sq_ready.3 +14 -8
- data/vendor/liburing/man/io_uring_sq_space_left.3 +9 -9
- data/vendor/liburing/man/io_uring_sqe_set_data.3 +29 -11
- data/vendor/liburing/man/io_uring_sqe_set_data64.3 +1 -0
- data/vendor/liburing/man/io_uring_sqe_set_flags.3 +38 -11
- data/vendor/liburing/man/io_uring_sqring_wait.3 +13 -9
- data/vendor/liburing/man/io_uring_submit.3 +29 -12
- data/vendor/liburing/man/io_uring_submit_and_get_events.3 +31 -0
- data/vendor/liburing/man/io_uring_submit_and_wait.3 +16 -12
- data/vendor/liburing/man/io_uring_submit_and_wait_timeout.3 +30 -23
- data/vendor/liburing/man/io_uring_unregister_buf_ring.3 +30 -0
- data/vendor/liburing/man/io_uring_unregister_buffers.3 +11 -10
- data/vendor/liburing/man/io_uring_unregister_eventfd.3 +1 -0
- data/vendor/liburing/man/io_uring_unregister_files.3 +11 -10
- data/vendor/liburing/man/io_uring_unregister_iowq_aff.3 +1 -0
- data/vendor/liburing/man/io_uring_unregister_ring_fd.3 +32 -0
- data/vendor/liburing/man/io_uring_wait_cqe.3 +19 -12
- data/vendor/liburing/man/io_uring_wait_cqe_nr.3 +21 -14
- data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +27 -13
- data/vendor/liburing/man/io_uring_wait_cqes.3 +24 -14
- data/vendor/liburing/src/Makefile +8 -7
- data/vendor/liburing/src/arch/aarch64/lib.h +48 -0
- data/vendor/liburing/src/arch/aarch64/syscall.h +0 -4
- data/vendor/liburing/src/arch/generic/lib.h +0 -4
- data/vendor/liburing/src/arch/generic/syscall.h +29 -16
- data/vendor/liburing/src/arch/syscall-defs.h +41 -14
- data/vendor/liburing/src/arch/x86/lib.h +0 -21
- data/vendor/liburing/src/arch/x86/syscall.h +146 -10
- data/vendor/liburing/src/include/liburing/io_uring.h +245 -5
- data/vendor/liburing/src/include/liburing.h +468 -35
- data/vendor/liburing/src/int_flags.h +1 -0
- data/vendor/liburing/src/lib.h +20 -16
- data/vendor/liburing/src/liburing.map +16 -0
- data/vendor/liburing/src/nolibc.c +1 -1
- data/vendor/liburing/src/queue.c +87 -55
- data/vendor/liburing/src/register.c +129 -53
- data/vendor/liburing/src/setup.c +65 -28
- data/vendor/liburing/src/syscall.c +14 -32
- data/vendor/liburing/src/syscall.h +12 -64
- data/vendor/liburing/test/{232c93d07b74-test.c → 232c93d07b74.c} +8 -9
- data/vendor/liburing/test/{35fa71a030ca-test.c → 35fa71a030ca.c} +4 -4
- data/vendor/liburing/test/{500f9fbadef8-test.c → 500f9fbadef8.c} +7 -7
- data/vendor/liburing/test/{7ad0e4b2f83c-test.c → 7ad0e4b2f83c.c} +8 -7
- data/vendor/liburing/test/{8a9973408177-test.c → 8a9973408177.c} +4 -3
- data/vendor/liburing/test/{917257daa0fe-test.c → 917257daa0fe.c} +3 -2
- data/vendor/liburing/test/Makefile +60 -62
- data/vendor/liburing/test/{a0908ae19763-test.c → a0908ae19763.c} +3 -2
- data/vendor/liburing/test/{a4c0b3decb33-test.c → a4c0b3decb33.c} +3 -2
- data/vendor/liburing/test/accept-link.c +5 -4
- data/vendor/liburing/test/accept-reuse.c +17 -16
- data/vendor/liburing/test/accept-test.c +14 -10
- data/vendor/liburing/test/accept.c +529 -107
- data/vendor/liburing/test/across-fork.c +7 -6
- data/vendor/liburing/test/{b19062a56726-test.c → b19062a56726.c} +3 -2
- data/vendor/liburing/test/{b5837bd5311d-test.c → b5837bd5311d.c} +10 -9
- data/vendor/liburing/test/buf-ring.c +420 -0
- data/vendor/liburing/test/{ce593a6c480a-test.c → ce593a6c480a.c} +15 -12
- data/vendor/liburing/test/connect.c +8 -7
- data/vendor/liburing/test/cq-full.c +5 -4
- data/vendor/liburing/test/cq-overflow.c +242 -12
- data/vendor/liburing/test/cq-peek-batch.c +5 -4
- data/vendor/liburing/test/cq-ready.c +5 -4
- data/vendor/liburing/test/cq-size.c +5 -4
- data/vendor/liburing/test/{d4ae271dfaae-test.c → d4ae271dfaae.c} +2 -2
- data/vendor/liburing/test/{d77a67ed5f27-test.c → d77a67ed5f27.c} +6 -6
- data/vendor/liburing/test/defer-taskrun.c +336 -0
- data/vendor/liburing/test/defer.c +26 -14
- data/vendor/liburing/test/double-poll-crash.c +15 -5
- data/vendor/liburing/test/drop-submit.c +5 -3
- data/vendor/liburing/test/{eeed8b54e0df-test.c → eeed8b54e0df.c} +7 -6
- data/vendor/liburing/test/empty-eownerdead.c +4 -4
- data/vendor/liburing/test/eventfd-disable.c +48 -20
- data/vendor/liburing/test/eventfd-reg.c +10 -9
- data/vendor/liburing/test/eventfd-ring.c +13 -12
- data/vendor/liburing/test/eventfd.c +13 -12
- data/vendor/liburing/test/exit-no-cleanup.c +1 -1
- data/vendor/liburing/test/fadvise.c +3 -3
- data/vendor/liburing/test/fallocate.c +16 -9
- data/vendor/liburing/test/{fc2a85cb02ef-test.c → fc2a85cb02ef.c} +4 -3
- data/vendor/liburing/test/fd-pass.c +187 -0
- data/vendor/liburing/test/file-register.c +302 -36
- data/vendor/liburing/test/file-update.c +62 -4
- data/vendor/liburing/test/file-verify.c +6 -2
- data/vendor/liburing/test/files-exit-hang-poll.c +11 -25
- data/vendor/liburing/test/files-exit-hang-timeout.c +13 -10
- data/vendor/liburing/test/fixed-buf-iter.c +115 -0
- data/vendor/liburing/test/fixed-link.c +10 -10
- data/vendor/liburing/test/fixed-reuse.c +160 -0
- data/vendor/liburing/test/fpos.c +6 -3
- data/vendor/liburing/test/fsync.c +3 -3
- data/vendor/liburing/test/hardlink.c +10 -6
- data/vendor/liburing/test/helpers.c +137 -4
- data/vendor/liburing/test/helpers.h +27 -0
- data/vendor/liburing/test/io-cancel.c +16 -11
- data/vendor/liburing/test/io_uring_enter.c +46 -81
- data/vendor/liburing/test/io_uring_passthrough.c +451 -0
- data/vendor/liburing/test/io_uring_register.c +59 -229
- data/vendor/liburing/test/io_uring_setup.c +24 -29
- data/vendor/liburing/test/iopoll-leak.c +85 -0
- data/vendor/liburing/test/iopoll.c +16 -9
- data/vendor/liburing/test/lfs-openat-write.c +3 -1
- data/vendor/liburing/test/link-timeout.c +4 -3
- data/vendor/liburing/test/link.c +8 -7
- data/vendor/liburing/test/madvise.c +2 -2
- data/vendor/liburing/test/mkdir.c +9 -5
- data/vendor/liburing/test/msg-ring.c +46 -20
- data/vendor/liburing/test/multicqes_drain.c +51 -12
- data/vendor/liburing/test/nolibc.c +60 -0
- data/vendor/liburing/test/nop.c +78 -16
- data/vendor/liburing/test/nvme.h +168 -0
- data/vendor/liburing/test/open-direct-link.c +188 -0
- data/vendor/liburing/test/open-direct-pick.c +180 -0
- data/vendor/liburing/test/openat2.c +3 -3
- data/vendor/liburing/test/poll-cancel-all.c +472 -0
- data/vendor/liburing/test/poll-link.c +9 -18
- data/vendor/liburing/test/poll-mshot-overflow.c +162 -0
- data/vendor/liburing/test/poll-mshot-update.c +83 -33
- data/vendor/liburing/test/pollfree.c +2 -2
- data/vendor/liburing/test/read-before-exit.c +112 -0
- data/vendor/liburing/test/read-write.c +83 -1
- data/vendor/liburing/test/recv-msgall-stream.c +398 -0
- data/vendor/liburing/test/recv-msgall.c +265 -0
- data/vendor/liburing/test/recv-multishot.c +505 -0
- data/vendor/liburing/test/rename.c +2 -5
- data/vendor/liburing/test/ring-leak.c +97 -0
- data/vendor/liburing/test/ringbuf-read.c +200 -0
- data/vendor/liburing/test/rsrc_tags.c +25 -13
- data/vendor/liburing/test/runtests-quiet.sh +11 -0
- data/vendor/liburing/test/runtests.sh +18 -20
- data/vendor/liburing/test/rw_merge_test.c +3 -2
- data/vendor/liburing/test/send-zerocopy.c +684 -0
- data/vendor/liburing/test/send_recv.c +49 -2
- data/vendor/liburing/test/send_recvmsg.c +165 -55
- data/vendor/liburing/test/shutdown.c +3 -4
- data/vendor/liburing/test/sigfd-deadlock.c +22 -8
- data/vendor/liburing/test/single-issuer.c +171 -0
- data/vendor/liburing/test/socket-rw-eagain.c +2 -12
- data/vendor/liburing/test/socket-rw-offset.c +2 -11
- data/vendor/liburing/test/socket-rw.c +2 -11
- data/vendor/liburing/test/socket.c +409 -0
- data/vendor/liburing/test/sq-poll-dup.c +1 -1
- data/vendor/liburing/test/sq-poll-share.c +1 -1
- data/vendor/liburing/test/statx.c +2 -2
- data/vendor/liburing/test/submit-and-wait.c +108 -0
- data/vendor/liburing/test/submit-link-fail.c +5 -3
- data/vendor/liburing/test/submit-reuse.c +0 -2
- data/vendor/liburing/test/sync-cancel.c +235 -0
- data/vendor/liburing/test/test.h +35 -0
- data/vendor/liburing/test/timeout-overflow.c +11 -11
- data/vendor/liburing/test/timeout.c +7 -7
- data/vendor/liburing/test/tty-write-dpoll.c +60 -0
- data/vendor/liburing/test/unlink.c +1 -1
- data/vendor/liburing/test/xattr.c +425 -0
- metadata +148 -26
- data/Gemfile.lock +0 -82
|
@@ -4,20 +4,22 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
6
6
|
.\"
|
|
7
|
-
.TH
|
|
7
|
+
.TH io_uring_setup 2 2019-01-29 "Linux" "Linux Programmer's Manual"
|
|
8
8
|
.SH NAME
|
|
9
9
|
io_uring_setup \- setup a context for performing asynchronous I/O
|
|
10
10
|
.SH SYNOPSIS
|
|
11
11
|
.nf
|
|
12
|
-
.BR "#include <
|
|
12
|
+
.BR "#include <liburing.h>"
|
|
13
13
|
.PP
|
|
14
14
|
.BI "int io_uring_setup(u32 " entries ", struct io_uring_params *" p );
|
|
15
15
|
.fi
|
|
16
|
-
.
|
|
16
|
+
.PPAA
|
|
17
17
|
.SH DESCRIPTION
|
|
18
18
|
.PP
|
|
19
|
-
The
|
|
20
|
-
|
|
19
|
+
The
|
|
20
|
+
.BR io_uring_setup (2)
|
|
21
|
+
system call sets up a submission queue (SQ) and completion queue (CQ) with at
|
|
22
|
+
least
|
|
21
23
|
.I entries
|
|
22
24
|
entries, and returns a file descriptor which can be used to perform
|
|
23
25
|
subsequent operations on the io_uring instance. The submission and
|
|
@@ -171,7 +173,7 @@ then it will be clamped at
|
|
|
171
173
|
.B IORING_MAX_CQ_ENTRIES .
|
|
172
174
|
.TP
|
|
173
175
|
.B IORING_SETUP_ATTACH_WQ
|
|
174
|
-
This flag should be set in conjunction with
|
|
176
|
+
This flag should be set in conjunction with
|
|
175
177
|
.IR "struct io_uring_params.wq_fd"
|
|
176
178
|
being set to an existing io_uring ring file descriptor. When set, the
|
|
177
179
|
io_uring instance being created will share the asynchronous worker
|
|
@@ -188,7 +190,7 @@ for details on how to enable the ring. Available since 5.10.
|
|
|
188
190
|
.B IORING_SETUP_SUBMIT_ALL
|
|
189
191
|
Normally io_uring stops submitting a batch of request, if one of these requests
|
|
190
192
|
results in an error. This can cause submission of less than what is expected,
|
|
191
|
-
if a request ends in error while being submitted. If the ring is
|
|
193
|
+
if a request ends in error while being submitted. If the ring is created with
|
|
192
194
|
this flag,
|
|
193
195
|
.BR io_uring_enter (2)
|
|
194
196
|
will continue submitting requests even if it encounters an error submitting
|
|
@@ -196,6 +198,86 @@ a request. CQEs are still posted for errored request regardless of whether or
|
|
|
196
198
|
not this flag is set at ring creation time, the only difference is if the
|
|
197
199
|
submit sequence is halted or continued when an error is observed. Available
|
|
198
200
|
since 5.18.
|
|
201
|
+
.TP
|
|
202
|
+
.B IORING_SETUP_COOP_TASKRUN
|
|
203
|
+
By default, io_uring will interrupt a task running in userspace when a
|
|
204
|
+
completion event comes in. This is to ensure that completions run in a timely
|
|
205
|
+
manner. For a lot of use cases, this is overkill and can cause reduced
|
|
206
|
+
performance from both the inter-processor interrupt used to do this, the
|
|
207
|
+
kernel/user transition, the needless interruption of the tasks userspace
|
|
208
|
+
activities, and reduced batching if completions come in at a rapid rate. Most
|
|
209
|
+
applications don't need the forceful interruption, as the events are processed
|
|
210
|
+
at any kernel/user transition. The exception are setups where the application
|
|
211
|
+
uses multiple threads operating on the same ring, where the application
|
|
212
|
+
waiting on completions isn't the one that submitted them. For most other
|
|
213
|
+
use cases, setting this flag will improve performance. Available since 5.19.
|
|
214
|
+
.TP
|
|
215
|
+
.B IORING_SETUP_TASKRUN_FLAG
|
|
216
|
+
Used in conjunction with
|
|
217
|
+
.B IORING_SETUP_COOP_TASKRUN,
|
|
218
|
+
this provides a flag,
|
|
219
|
+
.B IORING_SQ_TASKRUN,
|
|
220
|
+
which is set in the SQ ring
|
|
221
|
+
.I flags
|
|
222
|
+
whenever completions are pending that should be processed. liburing will check
|
|
223
|
+
for this flag even when doing
|
|
224
|
+
.BR io_uring_peek_cqe (3)
|
|
225
|
+
and enter the kernel to process them, and applications can do the same. This
|
|
226
|
+
makes
|
|
227
|
+
.B IORING_SETUP_TASKRUN_FLAG
|
|
228
|
+
safe to use even when applications rely on a peek style operation on the CQ
|
|
229
|
+
ring to see if anything might be pending to reap. Available since 5.19.
|
|
230
|
+
.TP
|
|
231
|
+
.B IORING_SETUP_SQE128
|
|
232
|
+
If set, io_uring will use 128-byte SQEs rather than the normal 64-byte sized
|
|
233
|
+
variant. This is a requirement for using certain request types, as of 5.19
|
|
234
|
+
only the
|
|
235
|
+
.B IORING_OP_URING_CMD
|
|
236
|
+
passthrough command for NVMe passthrough needs this. Available since 5.19.
|
|
237
|
+
.TP
|
|
238
|
+
.B IORING_SETUP_CQE32
|
|
239
|
+
If set, io_uring will use 32-byte CQEs rather than the normal 16-byte sized
|
|
240
|
+
variant. This is a requirement for using certain request types, as of 5.19
|
|
241
|
+
only the
|
|
242
|
+
.B IORING_OP_URING_CMD
|
|
243
|
+
passthrough command for NVMe passthrough needs this. Available since 5.19.
|
|
244
|
+
.TP
|
|
245
|
+
.B IORING_SETUP_SINGLE_ISSUER
|
|
246
|
+
A hint to the kernel that only a single task (or thread) will submit requests, which is
|
|
247
|
+
used for internal optimisations. The submission task is either the task that created the
|
|
248
|
+
ring, or if
|
|
249
|
+
.B IORING_SETUP_R_DISABLED
|
|
250
|
+
is specified then it is the task that enables the ring through
|
|
251
|
+
.BR io_uring_register (2) .
|
|
252
|
+
The kernel enforces this rule, failing requests with
|
|
253
|
+
.B -EEXIST
|
|
254
|
+
if the restriction is violated.
|
|
255
|
+
Note that when
|
|
256
|
+
.B IORING_SETUP_SQPOLL
|
|
257
|
+
is set it is considered that the polling task is doing all submissions
|
|
258
|
+
on behalf of the userspace and so it always complies with the rule disregarding
|
|
259
|
+
how many userspace tasks do
|
|
260
|
+
.BR io_uring_enter(2).
|
|
261
|
+
Available since 6.0.
|
|
262
|
+
.TP
|
|
263
|
+
.B IORING_SETUP_DEFER_TASKRUN
|
|
264
|
+
By default, io_uring will process all outstanding work at the end of any system
|
|
265
|
+
call or thread interrupt. This can delay the application from making other progress.
|
|
266
|
+
Setting this flag will hint to io_uring that it should defer work until an
|
|
267
|
+
.BR io_uring_enter(2)
|
|
268
|
+
call with the
|
|
269
|
+
.B IORING_ENTER_GETEVENTS
|
|
270
|
+
flag set. This allows the application to request work to run just before it wants to
|
|
271
|
+
process completions.
|
|
272
|
+
This flag requires the
|
|
273
|
+
.BR IORING_SETUP_SINGLE_ISSUER
|
|
274
|
+
flag to be set, and also enforces that the call to
|
|
275
|
+
.BR io_uring_enter(2)
|
|
276
|
+
is called from the same thread that submitted requests.
|
|
277
|
+
Note that if this flag is set then it is the application's responsibility to periodically
|
|
278
|
+
trigger work (for example via any of the CQE waiting functions) or else completions may
|
|
279
|
+
not be delivered.
|
|
280
|
+
Available since 6.1.
|
|
199
281
|
.PP
|
|
200
282
|
If no flags are specified, the io_uring instance is setup for
|
|
201
283
|
interrupt driven I/O. I/O may be submitted using
|
|
@@ -218,7 +300,7 @@ call. The SQEs must still be allocated separately. This brings the necessary
|
|
|
218
300
|
calls down from three to two. Available since kernel 5.4.
|
|
219
301
|
.TP
|
|
220
302
|
.B IORING_FEAT_NODROP
|
|
221
|
-
If this flag is set, io_uring supports never dropping completion events.
|
|
303
|
+
If this flag is set, io_uring supports almost never dropping completion events.
|
|
222
304
|
If a completion event occurs and the CQ ring is full, the kernel stores
|
|
223
305
|
the event internally until such a time that the CQ ring has room for more
|
|
224
306
|
entries. If this overflow condition is entered, attempting to submit more
|
|
@@ -226,7 +308,14 @@ IO will fail with the
|
|
|
226
308
|
.B -EBUSY
|
|
227
309
|
error value, if it can't flush the overflown events to the CQ ring. If this
|
|
228
310
|
happens, the application must reap events from the CQ ring and attempt the
|
|
229
|
-
submit again.
|
|
311
|
+
submit again. If the kernel has no free memory to store the event internally
|
|
312
|
+
it will be visible by an increase in the overflow value on the cqring.
|
|
313
|
+
Available since kernel 5.5. Additionally
|
|
314
|
+
.BR io_uring_enter (2)
|
|
315
|
+
will return
|
|
316
|
+
.B -EBADR
|
|
317
|
+
the next time it would otherwise sleep waiting for completions (since kernel 5.19).
|
|
318
|
+
|
|
230
319
|
.TP
|
|
231
320
|
.B IORING_FEAT_SUBMIT_STABLE
|
|
232
321
|
If this flag is set, applications can be certain that any data for
|
|
@@ -337,6 +426,25 @@ If this flag is set, then io_uring supports a variety of features related
|
|
|
337
426
|
to fixed files and buffers. In particular, it indicates that registered
|
|
338
427
|
buffers can be updated in-place, whereas before the full set would have to
|
|
339
428
|
be unregistered first. Available since kernel 5.13.
|
|
429
|
+
.TP
|
|
430
|
+
.B IORING_FEAT_CQE_SKIP
|
|
431
|
+
If this flag is set, then io_uring supports setting
|
|
432
|
+
.B IOSQE_CQE_SKIP_SUCCESS
|
|
433
|
+
in the submitted SQE, indicating that no CQE should be generated for this
|
|
434
|
+
SQE if it executes normally. If an error happens processing the SQE, a
|
|
435
|
+
CQE with the appropriate error value will still be generated. Available since
|
|
436
|
+
kernel 5.17.
|
|
437
|
+
.TP
|
|
438
|
+
.B IORING_FEAT_LINKED_FILE
|
|
439
|
+
If this flag is set, then io_uring supports sane assignment of files for SQEs
|
|
440
|
+
that have dependencies. For example, if a chain of SQEs are submitted with
|
|
441
|
+
.B IOSQE_IO_LINK,
|
|
442
|
+
then kernels without this flag will prepare the file for each link upfront.
|
|
443
|
+
If a previous link opens a file with a known index, eg if direct descriptors
|
|
444
|
+
are used with open or accept, then file assignment needs to happen post
|
|
445
|
+
execution of that SQE. If this flag is set, then the kernel will defer
|
|
446
|
+
file assignment until execution of a given request is started. Available since
|
|
447
|
+
kernel 5.17.
|
|
340
448
|
|
|
341
449
|
.PP
|
|
342
450
|
The rest of the fields in the
|
|
@@ -486,11 +594,9 @@ or
|
|
|
486
594
|
.BR io_uring_enter (2)
|
|
487
595
|
system calls.
|
|
488
596
|
|
|
489
|
-
On error,
|
|
490
|
-
.B -1
|
|
491
|
-
is returned and
|
|
597
|
+
On error, a negative error code is returned. The caller should not rely on
|
|
492
598
|
.I errno
|
|
493
|
-
|
|
599
|
+
variable.
|
|
494
600
|
.PP
|
|
495
601
|
.SH ERRORS
|
|
496
602
|
.TP
|
|
@@ -2,24 +2,30 @@
|
|
|
2
2
|
.\"
|
|
3
3
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
4
|
.\"
|
|
5
|
-
.TH io_uring_sq_ready "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
5
|
+
.TH io_uring_sq_ready 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_sq_ready
|
|
7
|
+
io_uring_sq_ready \- number of unconsumed or unsubmitted entries in the SQ ring
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "unsigned io_uring_sq_ready(const struct io_uring *ring)"
|
|
12
|
+
.BI "unsigned io_uring_sq_ready(const struct io_uring *" ring ");"
|
|
13
13
|
.fi
|
|
14
|
-
.PP
|
|
15
14
|
.SH DESCRIPTION
|
|
16
15
|
.PP
|
|
17
|
-
The
|
|
18
|
-
|
|
16
|
+
The
|
|
17
|
+
.BR io_uring_sq_ready (3)
|
|
18
|
+
function returns the number of unconsumed (if SQPOLL) or unsubmitted entries
|
|
19
|
+
that exist in the SQ ring belonging to the
|
|
19
20
|
.I ring
|
|
20
21
|
param.
|
|
21
22
|
|
|
23
|
+
Usage of this function only applies if the ring has been setup with
|
|
24
|
+
.B IORING_SETUP_SQPOLL,
|
|
25
|
+
where request submissions, and hence consumption from the SQ ring, happens
|
|
26
|
+
through a polling thread.
|
|
27
|
+
|
|
22
28
|
.SH RETURN VALUE
|
|
23
29
|
Returns the number of unconsumed or unsubmitted entries in the SQ ring.
|
|
24
30
|
.SH SEE ALSO
|
|
25
|
-
.BR io_uring_cq_ready (3)
|
|
31
|
+
.BR io_uring_cq_ready (3)
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
.\"
|
|
3
3
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
4
|
.\"
|
|
5
|
-
.TH io_uring_sq_space-left "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
5
|
+
.TH io_uring_sq_space-left 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_sq_space_left
|
|
7
|
+
io_uring_sq_space_left \- free space in the SQ ring
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "unsigned io_uring_sq_space_left(const struct io_uring *ring)"
|
|
12
|
+
.BI "unsigned io_uring_sq_space_left(const struct io_uring *" ring ");"
|
|
13
13
|
.fi
|
|
14
|
-
.PP
|
|
15
14
|
.SH DESCRIPTION
|
|
16
15
|
.PP
|
|
17
|
-
The
|
|
18
|
-
|
|
16
|
+
The
|
|
17
|
+
.BR io_uring_sq_space_left (3)
|
|
18
|
+
function returns how much space is left in the SQ ring belonging to the
|
|
19
19
|
.I ring
|
|
20
20
|
param.
|
|
21
21
|
|
|
22
22
|
.SH RETURN VALUE
|
|
23
|
-
Returns the
|
|
23
|
+
Returns the number of availables entries in the SQ ring.
|
|
24
24
|
.SH SEE ALSO
|
|
25
|
-
.BR io_uring_sq_ready (3)
|
|
25
|
+
.BR io_uring_sq_ready (3)
|
|
@@ -4,27 +4,45 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_sqe_set_data 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_sqe_set_data
|
|
7
|
+
io_uring_sqe_set_data \- set user data for submission queue event
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "void io_uring_sqe_set_data(struct io_uring_sqe *sqe,"
|
|
13
|
-
.BI " void *user_data)"
|
|
12
|
+
.BI "void io_uring_sqe_set_data(struct io_uring_sqe *" sqe ","
|
|
13
|
+
.BI " void *" user_data ");"
|
|
14
|
+
.BI "
|
|
15
|
+
.BI "void io_uring_sqe_set_data64(struct io_uring_sqe *" sqe ","
|
|
16
|
+
.BI " __u64 " data ");"
|
|
14
17
|
.fi
|
|
15
|
-
.PP
|
|
16
18
|
.SH DESCRIPTION
|
|
17
19
|
.PP
|
|
18
|
-
The
|
|
20
|
+
The
|
|
21
|
+
.BR io_uring_sqe_set_data (3)
|
|
22
|
+
function stores a
|
|
19
23
|
.I user_data
|
|
20
24
|
pointer with the submission queue entry
|
|
21
|
-
.
|
|
25
|
+
.IR sqe .
|
|
26
|
+
|
|
27
|
+
The
|
|
28
|
+
.BR io_uring_sqe_set_data64 (3)
|
|
29
|
+
function stores a 64-bit
|
|
30
|
+
.I data
|
|
31
|
+
value with the submission queue entry
|
|
32
|
+
.IR sqe .
|
|
22
33
|
|
|
23
|
-
After the caller has requested
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
After the caller has requested a submission queue entry (SQE) with
|
|
35
|
+
.BR io_uring_get_sqe (3) ,
|
|
36
|
+
they can associate a data pointer or value with the SQE. Once the completion
|
|
37
|
+
arrives, the function
|
|
38
|
+
.BR io_uring_cqe_get_data (3)
|
|
39
|
+
or
|
|
40
|
+
.BR io_uring_cqe_get_data64 (3)
|
|
41
|
+
can be called to retrieve the data pointer or value associated with the
|
|
42
|
+
submitted request.
|
|
26
43
|
|
|
27
44
|
.SH RETURN VALUE
|
|
28
45
|
None
|
|
29
46
|
.SH SEE ALSO
|
|
30
|
-
.BR io_uring_get_sqe (3),
|
|
47
|
+
.BR io_uring_get_sqe (3),
|
|
48
|
+
.BR io_uring_cqe_get_data (3)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
io_uring_sqe_set_data.3
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
.\"
|
|
3
3
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
4
|
.\"
|
|
5
|
-
.TH io_uring_sqe_set_flags "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
5
|
+
.TH io_uring_sqe_set_flags 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_sqe_set_flags
|
|
7
|
+
io_uring_sqe_set_flags \- set flags for submission queue entry
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "void io_uring_sqe_set_flags(struct io_uring_sqe *sqe,"
|
|
13
|
-
.BI " unsigned flags)"
|
|
12
|
+
.BI "void io_uring_sqe_set_flags(struct io_uring_sqe *" sqe ","
|
|
13
|
+
.BI " unsigned " flags ");"
|
|
14
14
|
.fi
|
|
15
|
-
.PP
|
|
16
15
|
.SH DESCRIPTION
|
|
17
16
|
.PP
|
|
18
|
-
The
|
|
19
|
-
|
|
17
|
+
The
|
|
18
|
+
.BR io_uring_sqe_set_flags (3)
|
|
19
|
+
function allows the caller to change the behavior of the submission queue entry
|
|
20
|
+
by specifying flags. It enables the
|
|
20
21
|
.I flags
|
|
21
22
|
belonging to the
|
|
22
23
|
.I sqe
|
|
@@ -34,7 +35,10 @@ Normal operation for io_uring is to try and issue an sqe as non-blocking first,
|
|
|
34
35
|
and if that fails, execute it in an async manner. To support more efficient
|
|
35
36
|
overlapped operation of requests that the application knows/assumes will
|
|
36
37
|
always (or most of the time) block, the application can ask for an sqe to be
|
|
37
|
-
issued async from the start.
|
|
38
|
+
issued async from the start. Note that this flag immediately causes the SQE
|
|
39
|
+
to be offloaded to an async helper thread with no initial non-blocking attempt.
|
|
40
|
+
This may be less efficient and should not be used liberally or without
|
|
41
|
+
understanding the performance and efficiency tradeoffs.
|
|
38
42
|
.TP
|
|
39
43
|
.B IOSQE_IO_LINK
|
|
40
44
|
When this flag is specified, the SQE forms a link with the next SQE in the
|
|
@@ -46,15 +50,38 @@ last SQE in a submission has this flag set, it will still terminate the current
|
|
|
46
50
|
chain. This flag has no effect on previous SQE submissions, nor does it impact
|
|
47
51
|
SQEs that are outside of the chain tail. This means that multiple chains can be
|
|
48
52
|
executing in parallel, or chains and individual SQEs. Only members inside the
|
|
49
|
-
chain are serialized. A chain of SQEs will be broken
|
|
53
|
+
chain are serialized. A chain of SQEs will be broken if any request in that
|
|
50
54
|
chain ends in error.
|
|
51
55
|
.TP
|
|
56
|
+
.B IOSQE_IO_HARDLINK
|
|
57
|
+
Like
|
|
58
|
+
.B IOSQE_IO_LINK ,
|
|
59
|
+
except the links aren't severed if an error or unexpected result occurs.
|
|
60
|
+
.TP
|
|
52
61
|
.B IOSQE_IO_DRAIN
|
|
53
62
|
When this flag is specified, the SQE will not be started before previously
|
|
54
63
|
submitted SQEs have completed, and new SQEs will not be started before this
|
|
55
64
|
one completes.
|
|
65
|
+
.TP
|
|
66
|
+
.B IOSQE_CQE_SKIP_SUCCESS
|
|
67
|
+
Request that no CQE be generated for this request, if it completes successfully.
|
|
68
|
+
This can be useful in cases where the application doesn't need to know when
|
|
69
|
+
a specific request completed, if it completed successfully.
|
|
70
|
+
.TP
|
|
71
|
+
.B IOSQE_BUFFER_SELECT
|
|
72
|
+
If set, and if the request types supports it, select an IO buffer from the
|
|
73
|
+
indicated buffer group. This can be used with requests that read or receive
|
|
74
|
+
data from a file or socket, where buffer selection is deferred until the kernel
|
|
75
|
+
is ready to transfer data, instead of when the IO is originally submitted. The
|
|
76
|
+
application must also set the
|
|
77
|
+
.I buf_group
|
|
78
|
+
field in the SQE, indicating which previously registered buffer group to select
|
|
79
|
+
a buffer from.
|
|
56
80
|
|
|
57
81
|
.SH RETURN VALUE
|
|
58
82
|
None
|
|
59
83
|
.SH SEE ALSO
|
|
60
|
-
.BR io_uring_submit (3),
|
|
84
|
+
.BR io_uring_submit (3),
|
|
85
|
+
.BR io_uring_register (3)
|
|
86
|
+
.BR io_uring_register_buffers (3)
|
|
87
|
+
.BR io_uring_register_buf_ring (3)
|
|
@@ -2,29 +2,33 @@
|
|
|
2
2
|
.\"
|
|
3
3
|
.\" SPDX-License-Identifier: LGPL-2.0-or-later
|
|
4
4
|
.\"
|
|
5
|
-
.TH io_uring_sqring_wait "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
5
|
+
.TH io_uring_sqring_wait 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_sqring_wait
|
|
7
|
+
io_uring_sqring_wait \- wait for free space in the SQ ring
|
|
8
8
|
.SH SYNOPSIS
|
|
9
9
|
.nf
|
|
10
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
11
11
|
.PP
|
|
12
|
-
.BI "int io_uring_sqring_wait(struct io_uring *ring)"
|
|
12
|
+
.BI "int io_uring_sqring_wait(struct io_uring *" ring ");"
|
|
13
13
|
.fi
|
|
14
|
-
.PP
|
|
15
14
|
.SH DESCRIPTION
|
|
16
15
|
.PP
|
|
17
|
-
The function
|
|
18
|
-
|
|
16
|
+
The function
|
|
17
|
+
.BR io_uring_sqring_wait (3)
|
|
18
|
+
allows the caller to wait for space to free up in the SQ ring belonging to the
|
|
19
19
|
.I ring
|
|
20
20
|
param, which happens when the kernel side thread
|
|
21
21
|
has consumed one or more entries. If the SQ ring is currently non-full,
|
|
22
22
|
no action is taken.
|
|
23
23
|
|
|
24
|
-
This feature can only be used when
|
|
24
|
+
This feature can only be used when the ring has been setup with
|
|
25
|
+
.B IORING_SETUP_SQPOLL
|
|
26
|
+
and hence is using an offloaded approach to request submissions.
|
|
25
27
|
|
|
26
28
|
.SH RETURN VALUE
|
|
27
29
|
On success it returns the free space. If the kernel does not support the
|
|
28
30
|
feature, -EINVAL is returned.
|
|
29
31
|
.SH SEE ALSO
|
|
30
|
-
.BR io_uring_submit (3),
|
|
32
|
+
.BR io_uring_submit (3),
|
|
33
|
+
.BR io_uring_wait_cqe (3),
|
|
34
|
+
.BR io_uring_wait_cqes (3)
|
|
@@ -4,26 +4,43 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_submit 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_submit
|
|
8
|
-
.fi
|
|
7
|
+
io_uring_submit \- submit requests to the submission queue
|
|
9
8
|
.SH SYNOPSIS
|
|
10
9
|
.nf
|
|
11
|
-
.
|
|
12
|
-
.PP
|
|
13
|
-
.BI "int io_uring_submit(struct io_uring *ring)"
|
|
10
|
+
.B #include <liburing.h>
|
|
14
11
|
.PP
|
|
12
|
+
.BI "int io_uring_submit(struct io_uring *" ring ");"
|
|
13
|
+
.fi
|
|
15
14
|
.SH DESCRIPTION
|
|
16
15
|
.PP
|
|
17
|
-
The
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
The
|
|
17
|
+
.BR io_uring_submit (3)
|
|
18
|
+
function submits the next events to the submission queue belonging to the
|
|
19
|
+
.IR ring .
|
|
20
20
|
|
|
21
|
-
After the caller retrieves a submission queue entry (SQE) with
|
|
22
|
-
|
|
21
|
+
After the caller retrieves a submission queue entry (SQE) with
|
|
22
|
+
.BR io_uring_get_sqe (3)
|
|
23
|
+
and prepares the SQE using one of the provided helpers, it can be submitted with
|
|
24
|
+
.BR io_uring_submit (3) .
|
|
23
25
|
|
|
24
26
|
.SH RETURN VALUE
|
|
25
27
|
On success
|
|
26
28
|
.BR io_uring_submit (3)
|
|
27
|
-
returns the number of submitted submission queue entries. On failure it returns
|
|
29
|
+
returns the number of submitted submission queue entries. On failure it returns
|
|
30
|
+
.BR -errno .
|
|
31
|
+
.SH NOTES
|
|
32
|
+
For any request that passes in data in a struct, that data must remain
|
|
33
|
+
valid until the request has been successfully submitted. It need not remain
|
|
34
|
+
valid until completion. Once a request has been submitted, the in-kernel
|
|
35
|
+
state is stable. Very early kernels (5.4 and earlier) required state to be
|
|
36
|
+
stable until the completion occurred. Applications can test for this
|
|
37
|
+
behavior by inspecting the
|
|
38
|
+
.B IORING_FEAT_SUBMIT_STABLE
|
|
39
|
+
flag passed back from
|
|
40
|
+
.BR io_uring_queue_init_params (3).
|
|
41
|
+
In general, the man pages for the individual prep helpers will have a note
|
|
42
|
+
mentioning this fact as well, if required for the given command.
|
|
28
43
|
.SH SEE ALSO
|
|
29
|
-
.BR io_uring_get_sqe (3),
|
|
44
|
+
.BR io_uring_get_sqe (3),
|
|
45
|
+
.BR io_uring_submit_and_wait (3),
|
|
46
|
+
.BR io_uring_submit_and_wait_timeout (3)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.\" Copyright (C), 2022 dylany
|
|
2
|
+
.\" You may distribute this file under the terms of the GNU Free
|
|
3
|
+
.\" Documentation License.
|
|
4
|
+
.TH io_uring_submit_and_get_events 3 "September 5, 2022" "liburing-2.3" "liburing Manual"
|
|
5
|
+
.SH NAME
|
|
6
|
+
io_uring_submit_and_get_events \- submit requests to the submission queue and flush completions
|
|
7
|
+
.SH SYNOPSIS
|
|
8
|
+
.nf
|
|
9
|
+
.B #include <liburing.h>
|
|
10
|
+
.PP
|
|
11
|
+
.BI "int io_uring_submit_and_get_events(struct io_uring *" ring ");"
|
|
12
|
+
.fi
|
|
13
|
+
|
|
14
|
+
.SH DESCRIPTION
|
|
15
|
+
The
|
|
16
|
+
.BR io_uring_submit_and_get_events (3)
|
|
17
|
+
function submits the next events to the submission queue as with
|
|
18
|
+
.BR io_uring_submit (3) .
|
|
19
|
+
After submission it will flush CQEs as with
|
|
20
|
+
.BR io_uring_get_events (3) .
|
|
21
|
+
|
|
22
|
+
The benefit of this function is that it does both with only one system call.
|
|
23
|
+
|
|
24
|
+
.SH RETURN VALUE
|
|
25
|
+
On success
|
|
26
|
+
.BR io_uring_submit_and_get_events (3)
|
|
27
|
+
returns the number of submitted submission queue entries. On failure it returns
|
|
28
|
+
.BR -errno .
|
|
29
|
+
.SH SEE ALSO
|
|
30
|
+
.BR io_uring_submit (3),
|
|
31
|
+
.BR io_uring_get_events (3)
|
|
@@ -4,31 +4,35 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_submit_and_wait 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_submit_and_wait
|
|
8
|
-
.fi
|
|
7
|
+
io_uring_submit_and_wait \- submit requests to the submission queue and wait for completion
|
|
9
8
|
.SH SYNOPSIS
|
|
10
9
|
.nf
|
|
11
|
-
.
|
|
10
|
+
.B #include <liburing.h>
|
|
12
11
|
.PP
|
|
13
|
-
.BI "int io_uring_submit_and_wait(struct io_uring *ring,"
|
|
12
|
+
.BI "int io_uring_submit_and_wait(struct io_uring *" ring ","
|
|
13
|
+
.BI " unsigned " wait_nr ");"
|
|
14
14
|
.fi
|
|
15
|
-
.BI " unsigned wait_nr)"
|
|
16
|
-
.PP
|
|
17
15
|
.SH DESCRIPTION
|
|
18
16
|
.PP
|
|
19
|
-
The
|
|
20
|
-
|
|
17
|
+
The
|
|
18
|
+
.BR io_uring_submit_and_wait (3)
|
|
19
|
+
function submits the next requests from the submission queue belonging to the
|
|
21
20
|
.I ring
|
|
22
21
|
and waits for
|
|
23
22
|
.I wait_nr
|
|
24
23
|
completion events.
|
|
25
24
|
|
|
26
|
-
After the caller retrieves a submission queue entry (SQE) with
|
|
27
|
-
|
|
25
|
+
After the caller retrieves a submission queue entry (SQE) with
|
|
26
|
+
.BR io_uring_get_sqe (3)
|
|
27
|
+
and prepares the SQE, it can be submitted with
|
|
28
|
+
.BR io_uring_submit_and_wait (3) .
|
|
28
29
|
|
|
29
30
|
.SH RETURN VALUE
|
|
30
31
|
On success
|
|
31
32
|
.BR io_uring_submit_and_wait (3)
|
|
32
|
-
returns the number of submitted submission queue entries. On failure it returns
|
|
33
|
+
returns the number of submitted submission queue entries. On failure it returns
|
|
34
|
+
.BR -errno .
|
|
33
35
|
.SH SEE ALSO
|
|
34
|
-
.BR io_uring_get_sqe (3),
|
|
36
|
+
.BR io_uring_get_sqe (3),
|
|
37
|
+
.BR io_uring_submit (3),
|
|
38
|
+
.BR io_uring_submit_and_wait_timeout (3)
|
|
@@ -4,46 +4,53 @@
|
|
|
4
4
|
.\"
|
|
5
5
|
.TH io_uring_submit_and_wait_timeout 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
|
|
6
6
|
.SH NAME
|
|
7
|
-
io_uring_submit_and_wait_timeout
|
|
7
|
+
io_uring_submit_and_wait_timeout \- submit requests to the submission queue and
|
|
8
8
|
wait for the completion with timeout
|
|
9
|
-
.fi
|
|
10
9
|
.SH SYNOPSIS
|
|
11
10
|
.nf
|
|
12
|
-
.
|
|
11
|
+
.B #include <liburing.h>
|
|
13
12
|
.PP
|
|
14
|
-
.BI "int io_uring_submit_and_wait_timeout(struct io_uring *ring,"
|
|
15
|
-
.
|
|
16
|
-
.BI "
|
|
17
|
-
.
|
|
18
|
-
.BI "
|
|
13
|
+
.BI "int io_uring_submit_and_wait_timeout(struct io_uring *" ring ","
|
|
14
|
+
.BI " struct io_uring_cqe **" cqe_ptr ","
|
|
15
|
+
.BI " unsigned " wait_nr ","
|
|
16
|
+
.BI " struct __kernel_timespec *" ts ","
|
|
17
|
+
.BI " sigset_t *" sigmask ");"
|
|
19
18
|
.fi
|
|
20
|
-
.BI " struct __kernel_timespec *ts,"
|
|
21
|
-
.fi
|
|
22
|
-
.BI " sigset_t *sigmask)"
|
|
23
|
-
.PP
|
|
24
19
|
.SH DESCRIPTION
|
|
25
20
|
.PP
|
|
26
|
-
The
|
|
27
|
-
|
|
21
|
+
The
|
|
22
|
+
.BR io_uring_submit_and_wait_timeout (3)
|
|
23
|
+
function submits the next requests from the submission queue belonging to the
|
|
28
24
|
.I ring
|
|
29
25
|
and waits for
|
|
30
26
|
.I wait_nr
|
|
31
|
-
completion events or until the timeout
|
|
27
|
+
completion events, or until the timeout
|
|
32
28
|
.I ts
|
|
33
|
-
expires.The completion events are stored in the
|
|
34
|
-
.I cqe_ptr
|
|
35
|
-
The
|
|
29
|
+
expires. The completion events are stored in the
|
|
30
|
+
.I cqe_ptr
|
|
31
|
+
array. The
|
|
36
32
|
.I sigmask
|
|
37
33
|
specifies the set of signals to block. The prevailing signal mask is restored
|
|
38
34
|
before returning.
|
|
39
35
|
|
|
40
|
-
After the caller retrieves a submission queue entry (SQE) with
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
After the caller retrieves a submission queue entry (SQE) with
|
|
37
|
+
.BR io_uring_get_sqe (3)
|
|
38
|
+
and prepares the SQE, it can be submitted with
|
|
39
|
+
.BR io_uring_submit_and_wait_timeout (3) .
|
|
43
40
|
|
|
44
41
|
.SH RETURN VALUE
|
|
45
42
|
On success
|
|
46
43
|
.BR io_uring_submit_and_wait_timeout (3)
|
|
47
|
-
returns the number of submitted submission queue entries. On failure it returns
|
|
44
|
+
returns the number of submitted submission queue entries. On failure it returns
|
|
45
|
+
.BR -errno .
|
|
46
|
+
Note that in earlier versions of the liburing library, the return value was 0
|
|
47
|
+
on success.
|
|
48
|
+
The most common failure case is not receiving a completion within the specified
|
|
49
|
+
timeout,
|
|
50
|
+
.B -ETIME
|
|
51
|
+
is returned in this case.
|
|
48
52
|
.SH SEE ALSO
|
|
49
|
-
.BR io_uring_get_sqe (3),
|
|
53
|
+
.BR io_uring_get_sqe (3),
|
|
54
|
+
.BR io_uring_submit (3),
|
|
55
|
+
.BR io_uring_submit_and_wait (3),
|
|
56
|
+
.BR io_uring_wait_cqe (3)
|