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,53 +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_buf_ring_add 3 "May 18, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_buf_ring_add \- add buffers to a shared buffer ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "void io_uring_buf_ring_add(struct io_uring_buf_ring *" br ",
13
- .BI " void *" addr ",
14
- .BI " unsigned int " len ",
15
- .BI " unsigned short " bid ",
16
- .BI " int " mask ",
17
- .BI " int " buf_offset ");"
18
- .fi
19
- .SH DESCRIPTION
20
- .PP
21
- The
22
- .BR io_uring_buf_ring_add (3)
23
- adds a new buffer to the shared buffer ring
24
- .IR br .
25
- The buffer address is indicated by
26
- .I addr
27
- and is of
28
- .I len
29
- bytes of length.
30
- .I bid
31
- is the buffer ID, which will be returned in the CQE.
32
- .I mask
33
- is the size mask of the ring, available from
34
- .BR io_uring_buf_ring_mask (3) .
35
- .I buf_offset
36
- is the offset to insert at from the current tail. If just one buffer is provided
37
- before the ring tail is committed with
38
- .BR io_uring_buf_ring_advance (3)
39
- or
40
- .BR io_uring_buf_ring_cq_advance (3),
41
- then
42
- .I buf_offset
43
- should be 0. If buffers are provided in a loop before being committed, the
44
- .I buf_offset
45
- must be incremented by one for each buffer added.
46
-
47
- .SH RETURN VALUE
48
- None
49
- .SH SEE ALSO
50
- .BR io_uring_register_buf_ring (3),
51
- .BR io_uring_buf_ring_mask (3),
52
- .BR io_uring_buf_ring_advance (3),
53
- .BR io_uring_buf_ring_cq_advance (3)
@@ -1,31 +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_buf_ring_advance 3 "May 18, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_buf_ring_advance \- advance index of provided buffer in buffer ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "void io_uring_buf_ring_advance(struct io_uring_buf_ring *" br ",
13
- .BI " int " count ");"
14
- .fi
15
- .SH DESCRIPTION
16
- .PP
17
- The
18
- .BR io_uring_buf_ring_advance (3)
19
- commits
20
- .I count
21
- previously added buffers to the shared buffer ring
22
- .IR br ,
23
- making them visible to the kernel and hence consumable. This passes ownership
24
- of the buffer to the ring.
25
-
26
- .SH RETURN VALUE
27
- None
28
- .SH SEE ALSO
29
- .BR io_uring_register_buf_ring (3),
30
- .BR io_uring_buf_ring_add (3),
31
- .BR io_uring_buf_ring_cq_advance (3)
@@ -1,41 +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_buf_ring_cq_advance 3 "May 18, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_buf_ring_cq_advance \- advance index of provided buffer and CQ ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "void io_uring_buf_ring_cq_advance(struct io_uring *" ring ",
13
- .BI " struct io_uring_buf_ring *" br ",
14
- .BI " int " count ");"
15
- .fi
16
- .SH DESCRIPTION
17
- .PP
18
- The
19
- .BR io_uring_buf_ring_cq_advance (3)
20
- commits
21
- .I count
22
- previously added buffers to the shared buffer ring
23
- .IR br ,
24
- making them visible to the kernel and hence consumable. This passes ownership
25
- of the buffer to the ring. At the same time, it advances the CQ ring of
26
- .I ring
27
- by
28
- .I count
29
- amount. This effectively bundles both a
30
- .BR io_uring_buf_ring_advance (3)
31
- call and a
32
- .BR io_uring_cq_avance (3)
33
- into one operation. Since updating either ring index entails a store memory
34
- barrier, doing both at once is more efficient.
35
-
36
- .SH RETURN VALUE
37
- None
38
- .SH SEE ALSO
39
- .BR io_uring_register_buf_ring (3),
40
- .BR io_uring_buf_ring_add (3),
41
- .BR io_uring_buf_ring_advance (3)
@@ -1,30 +0,0 @@
1
- .\" Copyright (C) 2022 Dylan Yudaken <dylany@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_buf_ring_init 3 "June 13, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_buf_ring_init \- Initialise a buffer ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "void io_uring_buf_ring_init(struct io_uring_buf_ring *" br ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
16
- .BR io_uring_buf_ring_init (3)
17
- initialises
18
- .IR br
19
- so that it is ready to be used. It may be called after
20
- .BR io_uring_register_buf_ring (3)
21
- but must be called before the buffer ring is used in any other way.
22
-
23
- .SH RETURN VALUE
24
- None
25
-
26
- .SH SEE ALSO
27
- .BR io_uring_register_buf_ring (3),
28
- .BR io_uring_buf_ring_add (3)
29
- .BR io_uring_buf_ring_advance (3),
30
- .BR io_uring_buf_ring_cq_advance (3)
@@ -1,27 +0,0 @@
1
- .\" Copyright (C) 2022 Dylan Yudaken <dylany@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_buf_ring_mask 3 "June 13, 2022" "liburing-2.2" "liburing Manual"
6
- .SH NAME
7
- io_uring_buf_ring_mask \- Calculate buffer ring mask size
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "int io_uring_buf_ring_mask(__u32 " ring_entries ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
16
- .BR io_uring_buf_ring_mask (3)
17
- calculates the appropriate size mask for a buffer ring.
18
- .IR ring_entries
19
- is the ring entries as specified in
20
- .BR io_uring_register_buf_ring (3) .
21
-
22
- .SH RETURN VALUE
23
- Size mask for the buffer ring.
24
-
25
- .SH SEE ALSO
26
- .BR io_uring_register_buf_ring (3),
27
- .BR io_uring_buf_ring_add (3)
@@ -1,72 +0,0 @@
1
- .\" Copyright (C) 2022 Christian Hergert <chergert@redhat.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_check_version 3 "December 1, 2022" "liburing-2.4" "liburing Manual"
6
- .SH NAME
7
- io_uring_check_version \- functions and macros to check the liburing version
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "bool io_uring_check_version(int " major ", int " minor ");"
13
- .BI "IO_URING_CHECK_VERSION(" major ", " minor ");"
14
- .PP
15
- .BI "int io_uring_major_version(void);"
16
- .BI "IO_URING_VERSION_MAJOR;"
17
- .PP
18
- .BI "int io_uring_minor_version(void);"
19
- .BI "IO_URING_VERSION_MINOR;"
20
- .fi
21
- .SH DESCRIPTION
22
- .PP
23
- The
24
- .BR io_uring_check_version (3)
25
- function returns
26
- .I true
27
- if the liburing library loaded by the dynamic linker is greater-than
28
- or equal-to the
29
- .I major
30
- and
31
- .I minor
32
- numbers provided.
33
-
34
- .PP
35
- The
36
- .BR IO_URING_CHECK_VERSION (3)
37
- macro returns
38
- .I 1
39
- if the liburing library being compiled against is greater-than or equal-to the
40
- .I major
41
- and
42
- .I minor
43
- numbers provided.
44
-
45
- .PP
46
- The
47
- .BR io_uring_major_version (3)
48
- function returns the
49
- .I major
50
- version number of the liburing library loaded by the dynamic linker.
51
-
52
- .PP
53
- The
54
- .BR IO_URING_VERSION_MAJOR (3)
55
- macro returns the
56
- .I major
57
- version number of the liburing library being compiled against.
58
-
59
- .PP
60
- The
61
- .BR io_uring_minor_version (3)
62
- function returns the
63
- .I minor
64
- version number of the liburing library loaded by the dynamic linker.
65
-
66
- .PP
67
- The
68
- .BR IO_URING_VERSION_MINOR (3)
69
- macro returns the
70
- .I minor
71
- version number of the liburing library being compiled against.
72
-
@@ -1,43 +0,0 @@
1
- .\" Copyright (C) 2022 Jens Axboe <axboe@kernel.dk>
2
- .\" Copyright (C) 2022 Josh Triplett <josh@joshtriplett.org>
3
- .\"
4
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
5
- .\"
6
- .TH io_uring_close_ring_fd 3 "September 25, 2022" "liburing-2.4" "liburing Manual"
7
- .SH NAME
8
- io_uring_close_ring_fd \- close a ring file descriptor and use it only via registered index
9
- .SH SYNOPSIS
10
- .nf
11
- .B #include <liburing.h>
12
- .PP
13
- .BI "int io_uring_close_ring_fd(struct io_uring *" ring ");"
14
- .fi
15
- .SH DESCRIPTION
16
- .PP
17
- .BR io_uring_close_ring_fd (3)
18
- closes the ring file descriptor, which must have been previously registered.
19
- The file will remain open, but accessible only via the registered index, not
20
- via any file descriptor. Subsequent liburing calls will continue to work, using
21
- the registered ring fd.
22
-
23
- The kernel must support
24
- .BR IORING_FEAT_REG_REG_RING .
25
-
26
- Libraries that must avoid disrupting their users' uses of file descriptors, and
27
- must continue working even in the face of
28
- .BR close_range (2)
29
- and similar, can use
30
- .BR io_uring_close_ring_fd (3)
31
- to work with liburing without having any open file descriptor.
32
-
33
- .SH NOTES
34
- Each thread that wants to make use of io_uring must register the fd. A library
35
- that may get called from arbitrary theads may need to detect when it gets
36
- called on a previously unseen thread and create and register a ring for that
37
- thread.
38
- .SH RETURN VALUE
39
- Returns 1 on success, or
40
- .BR -errno
41
- on error.
42
- .SH SEE ALSO
43
- .BR io_uring_register_ring_fd (3)
@@ -1,49 +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_cq_advance 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_cq_advance \- mark one or more io_uring completion events as consumed
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "void io_uring_cq_advance(struct io_uring *" ring ","
13
- .BI " unsigned " nr ");"
14
- .fi
15
- .SH DESCRIPTION
16
- .PP
17
- The
18
- .BR io_uring_cq_advance (3)
19
- function marks
20
- .I nr
21
- IO completions belonging to the
22
- .I ring
23
- param as consumed.
24
-
25
- After the caller has submitted a request with
26
- .BR io_uring_submit (3),
27
- the application can retrieve the completion with
28
- .BR io_uring_wait_cqe (3),
29
- .BR io_uring_peek_cqe (3),
30
- or any of the other CQE retrieval helpers, and mark it as consumed with
31
- .BR io_uring_cqe_seen (3).
32
-
33
- The function
34
- .BR io_uring_cqe_seen (3)
35
- calls the function
36
- .BR io_uring_cq_advance (3).
37
-
38
- Completions must be marked as seen, so their slot can get reused. Failure to do
39
- so will result in the same completion being returned on the next invocation.
40
-
41
- .SH RETURN VALUE
42
- None
43
- .SH SEE ALSO
44
- .BR io_uring_submit (3),
45
- .BR io_uring_wait_cqe (3),
46
- .BR io_uring_peek_cqe (3),
47
- .BR io_uring_wait_cqes (3),
48
- .BR io_uring_wait_cqe_timeout (3),
49
- .BR io_uring_cqe_seen (3)
@@ -1,25 +0,0 @@
1
- .\" Copyright (C) 2022 Dylan Yudaken <dylany@fb.com>
2
- .\"
3
- .\" SPDX-License-Identifier: LGPL-2.0-or-later
4
- .\"
5
- .TH io_uring_cq_has_overflow 3 "September 5, 2022" "liburing-2.3" "liburing Manual"
6
- .SH NAME
7
- io_uring_cq_has_overflow \- returns if there are overflow entries waiting to move to the CQ ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "bool io_uring_cq_has_overflow(const struct io_uring *" ring ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
16
- The
17
- .BR io_uring_cq_has_overflow (3)
18
- function informs the application if CQ entries have overflowed and are waiting to be flushed to
19
- the CQ ring. For example using
20
- .BR io_uring_get_events (3)
21
- .
22
- .SH RETURN VALUE
23
- True if there are CQ entries waiting to be flushed to the CQ ring.
24
- .SH SEE ALSO
25
- .BR io_uring_get_events (3)
@@ -1,26 +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_cq_ready 3 "January 25, 2022" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_cq_ready \- returns number of unconsumed ready entries in the CQ ring
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "unsigned io_uring_cq_ready(const struct io_uring *" ring ");"
13
- .fi
14
- .SH DESCRIPTION
15
- .PP
16
- The
17
- .BR io_uring_cq_ready (3)
18
- function returns the number of unconsumed entries that are ready belonging to the
19
- .I ring
20
- param.
21
-
22
- .SH RETURN VALUE
23
- Returns the number of unconsumed ready entries in the CQ ring.
24
- .SH SEE ALSO
25
- .BR io_uring_submit (3),
26
- .BR io_uring_wait_cqe (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_cqe_get_data 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_cqe_get_data \- get user data for completion event
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "void *io_uring_cqe_get_data(struct io_uring_cqe *" cqe ");"
13
- .BI "
14
- .BI "__u64 io_uring_cqe_get_data64(struct io_uring_cqe *" cqe ");"
15
- .fi
16
- .SH DESCRIPTION
17
- .PP
18
- The
19
- .BR io_uring_cqe_get_data (3)
20
- function returns the user_data with the completion queue entry
21
- .IR cqe
22
- as a data pointer.
23
-
24
- The
25
- .BR io_uring_cqe_get_data64 (3)
26
- function returns the user_data with the completion queue entry
27
- .IR cqe
28
- as a 64-bit data value.
29
-
30
- After the caller has received a completion queue entry (CQE) with
31
- .BR io_uring_wait_cqe (3),
32
- the application can call
33
- .BR io_uring_cqe_get_data (3)
34
- or
35
- .BR io_uring_cqe_get_data64 (3)
36
- function to retrieve the
37
- .I user_data
38
- value. This requires that
39
- .I user_data
40
- has been set earlier with the function
41
- .BR io_uring_sqe_set_data (3)
42
- or
43
- .BR io_uring_sqe_set_data64 (3).
44
-
45
- .SH RETURN VALUE
46
- If the
47
- .I user_data
48
- value has been set before submitting the request, it will be returned.
49
- Otherwise the functions returns NULL.
50
- .SH SEE ALSO
51
- .BR io_uring_get_sqe (3),
52
- .BR io_uring_sqe_set_data (3),
53
- .BR io_uring_sqe_submit (3)
@@ -1 +0,0 @@
1
- io_uring_cqe_get_data.3
@@ -1,42 +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_cqe_seen 3 "November 15, 2021" "liburing-2.1" "liburing Manual"
6
- .SH NAME
7
- io_uring_cqe_seen \- mark io_uring completion event as consumed
8
- .SH SYNOPSIS
9
- .nf
10
- .B #include <liburing.h>
11
- .PP
12
- .BI "void io_uring_cqe_seen(struct io_uring *" ring ","
13
- .BI " struct io_uring_cqe *" cqe ");"
14
- .fi
15
- .SH DESCRIPTION
16
- .PP
17
- The
18
- .BR io_uring_cqe_seen (3)
19
- function marks the IO completion
20
- .I cqe
21
- belonging to the
22
- .I ring
23
- param as consumed.
24
-
25
- After the caller has submitted a request with
26
- .BR io_uring_submit (3),
27
- the application can retrieve the completion with
28
- .BR io_uring_wait_cqe (3),
29
- .BR io_uring_peek_cqe (3),
30
- or any of the other CQE retrieval helpers, and mark it as consumed with
31
- .BR io_uring_cqe_seen (3).
32
-
33
- Completions must be marked as completed so their slot can get reused.
34
- .SH RETURN VALUE
35
- None
36
- .SH SEE ALSO
37
- .BR io_uring_submit (3),
38
- .BR io_uring_wait_cqe (3),
39
- .BR io_uring_peek_cqe (3),
40
- .BR io_uring_wait_cqes (3),
41
- .BR io_uring_wait_cqe_timeout (3),
42
- .BR io_uring_cqe_seen (3)