polyphony 1.0.1 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/.github/workflows/test_io_uring.yml +1 -1
  4. data/.yardopts +1 -0
  5. data/CHANGELOG.md +9 -0
  6. data/README.md +1 -0
  7. data/TODO.md +6 -12
  8. data/docs/advanced-io.md +224 -0
  9. data/docs/cheat-sheet.md +2 -2
  10. data/docs/readme.md +1 -0
  11. data/examples/core/debug.rb +12 -0
  12. data/examples/core/rpc_benchmark.rb +136 -0
  13. data/examples/core/stream_mockup.rb +68 -0
  14. data/examples/core/throttled_loop_inside_move_on_after.rb +13 -0
  15. data/ext/polyphony/backend_common.c +3 -5
  16. data/ext/polyphony/backend_common.h +10 -1
  17. data/ext/polyphony/backend_io_uring.c +6 -6
  18. data/ext/polyphony/backend_libev.c +5 -5
  19. data/ext/polyphony/extconf.rb +6 -0
  20. data/ext/polyphony/fiber.c +21 -1
  21. data/lib/polyphony/extensions/fiber.rb +1 -0
  22. data/lib/polyphony/extensions/io.rb +74 -74
  23. data/lib/polyphony/extensions/object.rb +6 -0
  24. data/lib/polyphony/extensions/socket.rb +39 -39
  25. data/lib/polyphony/version.rb +1 -1
  26. data/polyphony.gemspec +3 -1
  27. data/test/stress.rb +1 -1
  28. data/test/test_fiber.rb +45 -1
  29. data/test/test_io.rb +46 -0
  30. data/test/test_process_supervision.rb +1 -1
  31. data/test/test_resource_pool.rb +1 -1
  32. data/test/test_scenarios.rb +38 -0
  33. data/test/test_socket.rb +1 -2
  34. data/test/test_thread_pool.rb +4 -2
  35. data/test/test_timer.rb +2 -2
  36. metadata +36 -149
  37. data/vendor/liburing/man/IO_URING_CHECK_VERSION.3 +0 -1
  38. data/vendor/liburing/man/IO_URING_VERSION_MAJOR.3 +0 -1
  39. data/vendor/liburing/man/IO_URING_VERSION_MINOR.3 +0 -1
  40. data/vendor/liburing/man/io_uring.7 +0 -781
  41. data/vendor/liburing/man/io_uring_buf_ring_add.3 +0 -53
  42. data/vendor/liburing/man/io_uring_buf_ring_advance.3 +0 -31
  43. data/vendor/liburing/man/io_uring_buf_ring_cq_advance.3 +0 -41
  44. data/vendor/liburing/man/io_uring_buf_ring_init.3 +0 -30
  45. data/vendor/liburing/man/io_uring_buf_ring_mask.3 +0 -27
  46. data/vendor/liburing/man/io_uring_check_version.3 +0 -72
  47. data/vendor/liburing/man/io_uring_close_ring_fd.3 +0 -43
  48. data/vendor/liburing/man/io_uring_cq_advance.3 +0 -49
  49. data/vendor/liburing/man/io_uring_cq_has_overflow.3 +0 -25
  50. data/vendor/liburing/man/io_uring_cq_ready.3 +0 -26
  51. data/vendor/liburing/man/io_uring_cqe_get_data.3 +0 -53
  52. data/vendor/liburing/man/io_uring_cqe_get_data64.3 +0 -1
  53. data/vendor/liburing/man/io_uring_cqe_seen.3 +0 -42
  54. data/vendor/liburing/man/io_uring_enter.2 +0 -1700
  55. data/vendor/liburing/man/io_uring_enter2.2 +0 -1
  56. data/vendor/liburing/man/io_uring_free_probe.3 +0 -27
  57. data/vendor/liburing/man/io_uring_get_events.3 +0 -33
  58. data/vendor/liburing/man/io_uring_get_probe.3 +0 -30
  59. data/vendor/liburing/man/io_uring_get_sqe.3 +0 -57
  60. data/vendor/liburing/man/io_uring_major_version.3 +0 -1
  61. data/vendor/liburing/man/io_uring_minor_version.3 +0 -1
  62. data/vendor/liburing/man/io_uring_opcode_supported.3 +0 -30
  63. data/vendor/liburing/man/io_uring_peek_cqe.3 +0 -38
  64. data/vendor/liburing/man/io_uring_prep_accept.3 +0 -197
  65. data/vendor/liburing/man/io_uring_prep_accept_direct.3 +0 -1
  66. data/vendor/liburing/man/io_uring_prep_cancel.3 +0 -118
  67. data/vendor/liburing/man/io_uring_prep_cancel64.3 +0 -1
  68. data/vendor/liburing/man/io_uring_prep_close.3 +0 -59
  69. data/vendor/liburing/man/io_uring_prep_close_direct.3 +0 -1
  70. data/vendor/liburing/man/io_uring_prep_connect.3 +0 -66
  71. data/vendor/liburing/man/io_uring_prep_fadvise.3 +0 -59
  72. data/vendor/liburing/man/io_uring_prep_fallocate.3 +0 -59
  73. data/vendor/liburing/man/io_uring_prep_fgetxattr.3 +0 -1
  74. data/vendor/liburing/man/io_uring_prep_files_update.3 +0 -92
  75. data/vendor/liburing/man/io_uring_prep_fsetxattr.3 +0 -1
  76. data/vendor/liburing/man/io_uring_prep_fsync.3 +0 -70
  77. data/vendor/liburing/man/io_uring_prep_getxattr.3 +0 -61
  78. data/vendor/liburing/man/io_uring_prep_link.3 +0 -1
  79. data/vendor/liburing/man/io_uring_prep_link_timeout.3 +0 -94
  80. data/vendor/liburing/man/io_uring_prep_linkat.3 +0 -91
  81. data/vendor/liburing/man/io_uring_prep_madvise.3 +0 -56
  82. data/vendor/liburing/man/io_uring_prep_mkdir.3 +0 -1
  83. data/vendor/liburing/man/io_uring_prep_mkdirat.3 +0 -83
  84. data/vendor/liburing/man/io_uring_prep_msg_ring.3 +0 -92
  85. data/vendor/liburing/man/io_uring_prep_msg_ring_cqe_flags.3 +0 -1
  86. data/vendor/liburing/man/io_uring_prep_multishot_accept.3 +0 -1
  87. data/vendor/liburing/man/io_uring_prep_multishot_accept_direct.3 +0 -1
  88. data/vendor/liburing/man/io_uring_prep_nop.3 +0 -28
  89. data/vendor/liburing/man/io_uring_prep_openat.3 +0 -117
  90. data/vendor/liburing/man/io_uring_prep_openat2.3 +0 -117
  91. data/vendor/liburing/man/io_uring_prep_openat2_direct.3 +0 -1
  92. data/vendor/liburing/man/io_uring_prep_openat_direct.3 +0 -1
  93. data/vendor/liburing/man/io_uring_prep_poll_add.3 +0 -72
  94. data/vendor/liburing/man/io_uring_prep_poll_multishot.3 +0 -1
  95. data/vendor/liburing/man/io_uring_prep_poll_remove.3 +0 -55
  96. data/vendor/liburing/man/io_uring_prep_poll_update.3 +0 -89
  97. data/vendor/liburing/man/io_uring_prep_provide_buffers.3 +0 -140
  98. data/vendor/liburing/man/io_uring_prep_read.3 +0 -69
  99. data/vendor/liburing/man/io_uring_prep_read_fixed.3 +0 -72
  100. data/vendor/liburing/man/io_uring_prep_readv.3 +0 -85
  101. data/vendor/liburing/man/io_uring_prep_readv2.3 +0 -111
  102. data/vendor/liburing/man/io_uring_prep_recv.3 +0 -105
  103. data/vendor/liburing/man/io_uring_prep_recv_multishot.3 +0 -1
  104. data/vendor/liburing/man/io_uring_prep_recvmsg.3 +0 -124
  105. data/vendor/liburing/man/io_uring_prep_recvmsg_multishot.3 +0 -1
  106. data/vendor/liburing/man/io_uring_prep_remove_buffers.3 +0 -52
  107. data/vendor/liburing/man/io_uring_prep_rename.3 +0 -1
  108. data/vendor/liburing/man/io_uring_prep_renameat.3 +0 -96
  109. data/vendor/liburing/man/io_uring_prep_send.3 +0 -66
  110. data/vendor/liburing/man/io_uring_prep_send_set_addr.3 +0 -38
  111. data/vendor/liburing/man/io_uring_prep_send_zc.3 +0 -96
  112. data/vendor/liburing/man/io_uring_prep_send_zc_fixed.3 +0 -1
  113. data/vendor/liburing/man/io_uring_prep_sendmsg.3 +0 -89
  114. data/vendor/liburing/man/io_uring_prep_sendmsg_zc.3 +0 -1
  115. data/vendor/liburing/man/io_uring_prep_setxattr.3 +0 -64
  116. data/vendor/liburing/man/io_uring_prep_shutdown.3 +0 -53
  117. data/vendor/liburing/man/io_uring_prep_socket.3 +0 -118
  118. data/vendor/liburing/man/io_uring_prep_socket_direct.3 +0 -1
  119. data/vendor/liburing/man/io_uring_prep_socket_direct_alloc.3 +0 -1
  120. data/vendor/liburing/man/io_uring_prep_splice.3 +0 -120
  121. data/vendor/liburing/man/io_uring_prep_statx.3 +0 -74
  122. data/vendor/liburing/man/io_uring_prep_symlink.3 +0 -1
  123. data/vendor/liburing/man/io_uring_prep_symlinkat.3 +0 -85
  124. data/vendor/liburing/man/io_uring_prep_sync_file_range.3 +0 -59
  125. data/vendor/liburing/man/io_uring_prep_tee.3 +0 -74
  126. data/vendor/liburing/man/io_uring_prep_timeout.3 +0 -95
  127. data/vendor/liburing/man/io_uring_prep_timeout_remove.3 +0 -1
  128. data/vendor/liburing/man/io_uring_prep_timeout_update.3 +0 -98
  129. data/vendor/liburing/man/io_uring_prep_unlink.3 +0 -1
  130. data/vendor/liburing/man/io_uring_prep_unlinkat.3 +0 -82
  131. data/vendor/liburing/man/io_uring_prep_write.3 +0 -67
  132. data/vendor/liburing/man/io_uring_prep_write_fixed.3 +0 -72
  133. data/vendor/liburing/man/io_uring_prep_writev.3 +0 -85
  134. data/vendor/liburing/man/io_uring_prep_writev2.3 +0 -111
  135. data/vendor/liburing/man/io_uring_queue_exit.3 +0 -26
  136. data/vendor/liburing/man/io_uring_queue_init.3 +0 -89
  137. data/vendor/liburing/man/io_uring_queue_init_params.3 +0 -1
  138. data/vendor/liburing/man/io_uring_recvmsg_cmsg_firsthdr.3 +0 -1
  139. data/vendor/liburing/man/io_uring_recvmsg_cmsg_nexthdr.3 +0 -1
  140. data/vendor/liburing/man/io_uring_recvmsg_name.3 +0 -1
  141. data/vendor/liburing/man/io_uring_recvmsg_out.3 +0 -82
  142. data/vendor/liburing/man/io_uring_recvmsg_payload.3 +0 -1
  143. data/vendor/liburing/man/io_uring_recvmsg_payload_length.3 +0 -1
  144. data/vendor/liburing/man/io_uring_recvmsg_validate.3 +0 -1
  145. data/vendor/liburing/man/io_uring_register.2 +0 -834
  146. data/vendor/liburing/man/io_uring_register_buf_ring.3 +0 -140
  147. data/vendor/liburing/man/io_uring_register_buffers.3 +0 -104
  148. data/vendor/liburing/man/io_uring_register_buffers_sparse.3 +0 -1
  149. data/vendor/liburing/man/io_uring_register_buffers_tags.3 +0 -1
  150. data/vendor/liburing/man/io_uring_register_buffers_update_tag.3 +0 -1
  151. data/vendor/liburing/man/io_uring_register_eventfd.3 +0 -51
  152. data/vendor/liburing/man/io_uring_register_eventfd_async.3 +0 -1
  153. data/vendor/liburing/man/io_uring_register_file_alloc_range.3 +0 -52
  154. data/vendor/liburing/man/io_uring_register_files.3 +0 -112
  155. data/vendor/liburing/man/io_uring_register_files_sparse.3 +0 -1
  156. data/vendor/liburing/man/io_uring_register_files_tags.3 +0 -1
  157. data/vendor/liburing/man/io_uring_register_files_update.3 +0 -1
  158. data/vendor/liburing/man/io_uring_register_files_update_tag.3 +0 -1
  159. data/vendor/liburing/man/io_uring_register_iowq_aff.3 +0 -61
  160. data/vendor/liburing/man/io_uring_register_iowq_max_workers.3 +0 -71
  161. data/vendor/liburing/man/io_uring_register_ring_fd.3 +0 -49
  162. data/vendor/liburing/man/io_uring_register_sync_cancel.3 +0 -71
  163. data/vendor/liburing/man/io_uring_setup.2 +0 -669
  164. data/vendor/liburing/man/io_uring_sq_ready.3 +0 -31
  165. data/vendor/liburing/man/io_uring_sq_space_left.3 +0 -25
  166. data/vendor/liburing/man/io_uring_sqe_set_data.3 +0 -48
  167. data/vendor/liburing/man/io_uring_sqe_set_data64.3 +0 -1
  168. data/vendor/liburing/man/io_uring_sqe_set_flags.3 +0 -87
  169. data/vendor/liburing/man/io_uring_sqring_wait.3 +0 -34
  170. data/vendor/liburing/man/io_uring_submit.3 +0 -46
  171. data/vendor/liburing/man/io_uring_submit_and_get_events.3 +0 -31
  172. data/vendor/liburing/man/io_uring_submit_and_wait.3 +0 -38
  173. data/vendor/liburing/man/io_uring_submit_and_wait_timeout.3 +0 -56
  174. data/vendor/liburing/man/io_uring_unregister_buf_ring.3 +0 -30
  175. data/vendor/liburing/man/io_uring_unregister_buffers.3 +0 -27
  176. data/vendor/liburing/man/io_uring_unregister_eventfd.3 +0 -1
  177. data/vendor/liburing/man/io_uring_unregister_files.3 +0 -27
  178. data/vendor/liburing/man/io_uring_unregister_iowq_aff.3 +0 -1
  179. data/vendor/liburing/man/io_uring_unregister_ring_fd.3 +0 -32
  180. data/vendor/liburing/man/io_uring_wait_cqe.3 +0 -40
  181. data/vendor/liburing/man/io_uring_wait_cqe_nr.3 +0 -43
  182. data/vendor/liburing/man/io_uring_wait_cqe_timeout.3 +0 -53
  183. data/vendor/liburing/man/io_uring_wait_cqes.3 +0 -56
@@ -1,25 +0,0 @@
1
- .\" Copyright (C) 2022 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_sq_space-left 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_sq_space_left \- free space in the SQ ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "unsigned io_uring_sq_space_left(const struct io_uring *" ring ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
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
- .I ring
20
- param.
21
-
22
- .SH RETURN VALUE
23
- Returns the number of availables entries in the SQ ring.
24
- .SH SEE ALSO
25
- .BR io_uring_sq_ready (3)
@@ -1,48 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_sqe_set_data 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_sqe_set_data \- set user data for submission queue event
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
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 ");"
17
- .fi
18
- .SH DESCRIPTION
19
- .PP
20
- The
21
- .BR io_uring_sqe_set_data (3)
22
- function stores a
23
- .I user_data
24
- pointer with the submission queue entry
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 .
33
-
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.
43
-
44
- .SH RETURN VALUE
45
- None
46
- .SH SEE ALSO
47
- .BR io_uring_get_sqe (3),
48
- .BR io_uring_cqe_get_data (3)
@@ -1 +0,0 @@
1
- io_uring_sqe_set_data.3
@@ -1,87 +0,0 @@
1
- .\" Copyright (C) 2022 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_sqe_set_flags 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_sqe_set_flags \- set flags for submission queue entry
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "void io_uring_sqe_set_flags(struct io_uring_sqe *" sqe ","
13
- .BI " unsigned " flags ");"
14
- .fi
15
- .SH DESCRIPTION
16
- .PP
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
21
- .I flags
22
- belonging to the
23
- .I sqe
24
- submission queue entry param.
25
-
26
- .I flags
27
- is a bit mask of 0 or more of the following values ORed together:
28
- .TP
29
- .B IOSQE_FIXED_FILE
30
- The file descriptor in the SQE refers to the index of a previously registered
31
- file or direct file descriptor, not a normal file descriptor.
32
- .TP
33
- .B IOSQE_ASYNC
34
- Normal operation for io_uring is to try and issue an sqe as non-blocking first,
35
- and if that fails, execute it in an async manner. To support more efficient
36
- overlapped operation of requests that the application knows/assumes will
37
- always (or most of the time) block, the application can ask for an sqe to be
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.
42
- .TP
43
- .B IOSQE_IO_LINK
44
- When this flag is specified, the SQE forms a link with the next SQE in the
45
- submission ring. That next SQE will not be started before the previous request
46
- completes. This, in effect, forms a chain of SQEs, which can be arbitrarily
47
- long. The tail of the chain is denoted by the first SQE that does not have this
48
- flag set. Chains are not supported across submission boundaries. Even if the
49
- last SQE in a submission has this flag set, it will still terminate the current
50
- chain. This flag has no effect on previous SQE submissions, nor does it impact
51
- SQEs that are outside of the chain tail. This means that multiple chains can be
52
- executing in parallel, or chains and individual SQEs. Only members inside the
53
- chain are serialized. A chain of SQEs will be broken if any request in that
54
- chain ends in error.
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
61
- .B IOSQE_IO_DRAIN
62
- When this flag is specified, the SQE will not be started before previously
63
- submitted SQEs have completed, and new SQEs will not be started before this
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.
80
-
81
- .SH RETURN VALUE
82
- None
83
- .SH SEE ALSO
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)
@@ -1,34 +0,0 @@
1
- .\" Copyright (C) 2022 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_sqring_wait 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_sqring_wait \- wait for free space in the SQ ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_sqring_wait(struct io_uring *" ring ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
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
- .I ring
20
- param, which happens when the kernel side thread
21
- has consumed one or more entries. If the SQ ring is currently non-full,
22
- no action is taken.
23
-
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.
27
-
28
- .SH RETURN VALUE
29
- On success it returns the free space. If the kernel does not support the
30
- feature, -EINVAL is returned.
31
- .SH SEE ALSO
32
- .BR io_uring_submit (3),
33
- .BR io_uring_wait_cqe (3),
34
- .BR io_uring_wait_cqes (3)
@@ -1,46 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_submit 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_submit \- submit requests to the submission queue
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_submit(struct io_uring *" ring ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
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
-
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) .
25
-
26
- .SH RETURN VALUE
27
- On success
28
- .BR io_uring_submit (3)
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.
43
- .SH SEE ALSO
44
- .BR io_uring_get_sqe (3),
45
- .BR io_uring_submit_and_wait (3),
46
- .BR io_uring_submit_and_wait_timeout (3)
@@ -1,31 +0,0 @@
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)
@@ -1,38 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_submit_and_wait 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_submit_and_wait \- submit requests to the submission queue and wait for completion
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_submit_and_wait(struct io_uring *" ring ","
13
- .BI " unsigned " wait_nr ");"
14
- .fi
15
- .SH DESCRIPTION
16
- .PP
17
- The
18
- .BR io_uring_submit_and_wait (3)
19
- function submits the next requests from the submission queue belonging to the
20
- .I ring
21
- and waits for
22
- .I wait_nr
23
- completion events.
24
-
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) .
29
-
30
- .SH RETURN VALUE
31
- On success
32
- .BR io_uring_submit_and_wait (3)
33
- returns the number of submitted submission queue entries. On failure it returns
34
- .BR -errno .
35
- .SH SEE ALSO
36
- .BR io_uring_get_sqe (3),
37
- .BR io_uring_submit (3),
38
- .BR io_uring_submit_and_wait_timeout (3)
@@ -1,56 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_submit_and_wait_timeout 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_submit_and_wait_timeout \- submit requests to the submission queue and
8
- wait for the completion with timeout
9
- .SH SYNOPSIS
10
- .nf
11
- .B #include <liburing.h>
12
- .PP
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 ");"
18
- .fi
19
- .SH DESCRIPTION
20
- .PP
21
- The
22
- .BR io_uring_submit_and_wait_timeout (3)
23
- function submits the next requests from the submission queue belonging to the
24
- .I ring
25
- and waits for
26
- .I wait_nr
27
- completion events, or until the timeout
28
- .I ts
29
- expires. The completion events are stored in the
30
- .I cqe_ptr
31
- array. The
32
- .I sigmask
33
- specifies the set of signals to block. The prevailing signal mask is restored
34
- before returning.
35
-
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) .
40
-
41
- .SH RETURN VALUE
42
- On success
43
- .BR io_uring_submit_and_wait_timeout (3)
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.
52
- .SH SEE ALSO
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)
@@ -1,30 +0,0 @@
1
- .\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_unregister_buf_ring 3 "May 18, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_unregister_buf_ring \- unregister a previously registered buffer ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_unregister_buf_ring(struct io_uring *" ring ",
13
- .BI " int " bgid ");"
14
- .BI "
15
- .fi
16
- .SH DESCRIPTION
17
- .PP
18
- The
19
- .BR io_uring_unregister_buf_ring (3)
20
- function unregisters a previously registered shared buffer ring indicated by
21
- .IR bgid .
22
-
23
- .SH RETURN VALUE
24
- On success
25
- .BR io_uring_unregister_buf_ring (3)
26
- returns 0. On failure it returns
27
- .BR -errno .
28
- .SH SEE ALSO
29
- .BR io_uring_register_buf_ring (3),
30
- .BR io_uring_buf_ring_free (3)
@@ -1,27 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_unregister_buffers 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_unregister_buffers \- unregister buffers for fixed buffer operations
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_unregister_buffers(struct io_uring *" ring ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
16
- The
17
- .BR io_uring_unregister_buffers (3)
18
- function unregisters the fixed buffers previously registered to the
19
- .IR ring .
20
-
21
- .SH RETURN VALUE
22
- On success
23
- .BR io_uring_unregister_buffers (3)
24
- returns 0. On failure it returns
25
- .BR -errno .
26
- .SH SEE ALSO
27
- .BR io_uring_register_buffers (3)
@@ -1 +0,0 @@
1
- io_uring_register_eventfd.3
@@ -1,27 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_unregister_files 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_unregister_files \- unregister file descriptors
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_unregister_files(struct io_uring *" ring ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
16
- The
17
- .BR io_uring_unregister_files (3)
18
- function unregisters the file descriptors previously registered to the
19
- .IR ring .
20
-
21
- .SH RETURN VALUE
22
- On success
23
- .BR io_uring_unregister_files (3)
24
- returns 0. On failure it returns
25
- .BR -errno .
26
- .SH SEE ALSO
27
- .BR io_uring_register_files (3)
@@ -1 +0,0 @@
1
- io_uring_register_iowq_aff.3
@@ -1,32 +0,0 @@
1
- .\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_unregister_ring_fd 3 "March 11, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_unregister_ring_fd \- unregister a ring file descriptor
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_unregister_ring_fd(struct io_uring *" ring ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
16
- .BR io_uring_unregister_ring_fd (3)
17
- unregisters the file descriptor of the ring.
18
-
19
- Unregisters a ring descriptor previously registered with the task. This is
20
- done automatically when
21
- .BR io_uring_queue_exit (3)
22
- is called, but can also be done to free up space for new ring registrations.
23
- For more information on ring descriptor registration, see
24
- .BR io_uring_register_ring_fd (3)
25
-
26
- .SH RETURN VALUE
27
- Returns 1 on success, indicating that one file descriptor was unregistered, or
28
- .BR -errno
29
- on error.
30
- .SH SEE ALSO
31
- .BR io_uring_register_ring_fd (3),
32
- .BR io_uring_register_files (3)
@@ -1,40 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_wait_cqe 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_wait_cqe \- wait for one io_uring completion event
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_wait_cqe(struct io_uring *" ring ","
13
- .BI " struct io_uring_cqe **" cqe_ptr ");"
14
- .fi
15
- .SH DESCRIPTION
16
- .PP
17
- The
18
- .BR io_uring_wait_cqe (3)
19
- function waits for an IO completion from the queue belonging to the
20
- .I ring
21
- param, waiting for it if necessary. If an event is already available in
22
- the ring when invoked, no waiting will occur. The
23
- .I cqe_ptr
24
- param is filled in on success.
25
-
26
- After the caller has submitted a request with
27
- .BR io_uring_submit (3),
28
- the application can retrieve the completion with
29
- .BR io_uring_wait_cqe (3).
30
-
31
- .SH RETURN VALUE
32
- On success
33
- .BR io_uring_wait_cqe (3)
34
- returns 0 and the cqe_ptr param is filled in. On failure it returns
35
- .BR -errno .
36
- The return value indicates the result of waiting for a CQE, and it has no
37
- relation to the CQE result itself.
38
- .SH SEE ALSO
39
- .BR io_uring_submit (3),
40
- .BR io_uring_wait_cqes (3)
@@ -1,43 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_wait_cqe_nr 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_wait_cqe_nr \- wait for one or more io_uring completion events
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_wait_cqe_nr(struct io_uring *" ring ","
13
- .BI " struct io_uring_cqe **" cqe_ptr ","
14
- .BI " unsigned " wait_nr ");"
15
- .fi
16
- .SH DESCRIPTION
17
- .PP
18
- The
19
- .BR io_uring_wait_cqe_nr (3)
20
- function returns
21
- .I wait_nr
22
- IO completion events from the queue belonging to the
23
- .I ring
24
- param, waiting for it if necessary. If the requested number of events are
25
- already available in the ring when invoked, no waiting will occur. The
26
- .I cqe_ptr
27
- param is filled in on success.
28
-
29
- After the caller has submitted a request with
30
- .BR io_uring_submit (3),
31
- the application can retrieve the completion with
32
- .BR io_uring_wait_cqe (3).
33
-
34
- .SH RETURN VALUE
35
- On success
36
- .BR io_uring_wait_cqe_nr (3)
37
- returns 0 and the cqe_ptr param is filled in. On failure it returns
38
- .BR -errno .
39
- The return value indicates the result of waiting for a CQE, and it has no
40
- relation to the CQE result itself.
41
- .SH SEE ALSO
42
- .BR io_uring_submit (3),
43
- .BR io_uring_wait_cqes (3)
@@ -1,53 +0,0 @@
1
- .\" Copyright (C) 2021 Stefan Roesch <shr@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_wait_cqe_timeout 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_wait_cqe_timeout \- wait for one io_uring completion event with timeout
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_wait_cqe_timeout(struct io_uring *" ring ","
13
- .BI " struct io_uring_cqe **" cqe_ptr ","
14
- .BI " struct __kernel_timespec *" ts ");"
15
- .fi
16
- .SH DESCRIPTION
17
- .PP
18
- The
19
- .BR io_uring_wait_cqe_timeout (3)
20
- function waits for one IO completion to be available from the queue belonging
21
- to the
22
- .I ring
23
- param, waiting for it if necessary or until the timeout
24
- .I ts
25
- expires. If an event is already available in the ring when invoked, no waiting
26
- will occur.
27
-
28
- The
29
- .I cqe_ptr
30
- param is filled in on success.
31
-
32
- If
33
- .I ts
34
- is specified and an older kernel without
35
- .B IORING_FEAT_EXT_ARG
36
- is used, the application does not need to call
37
- .BR io_uring_submit (3)
38
- before calling
39
- .BR io_uring_wait_cqes (3).
40
- For newer kernels with that feature flag set, there is no implied submit
41
- when waiting for a request.
42
-
43
- .SH RETURN VALUE
44
- On success
45
- .BR io_uring_wait_cqe_timeout (3)
46
- returns 0 and the cqe_ptr param is filled in. On failure it returns
47
- .BR -errno .
48
- The return value indicates the result of waiting for a CQE, and it has no
49
- relation to the CQE result itself.
50
- .SH SEE ALSO
51
- .BR io_uring_submit (3),
52
- .BR io_uring_wait_cqe_timeout (3),
53
- .BR io_uring_wait_cqe (3)