io_uring: add IPC channel infrastructure
cover io_uring: add IPC channel infrastructure
io_uring currently lacks a dedicated mechanism for efficient inter-process communication. Applications needing low-latency IPC must use pipes, Unix domain sockets, or hand-roll shared memory with manual synchronization -- none of which integrate with the io_uring completion model or offer built-in fan-out semantics.
This series adds an IPC channel primitive to io_uring that provides:
- Shared memory ring buffer for zero-copy-style message passing
- Lock-free CAS-based producer (no mutex on the send hot path)
- RCU-based subscriber lookup on send/recv paths
- Three delivery modes:
* Unicast: single consumer, shared consumer.head via cmpxchg
* Broadcast: all subscribers receive every message via per-subscriber local_head tracking
* Multicast: round-robin distribution across receivers with cached recv_count for O(1) target selection
- Lazy broadcast consumer.head advancement (amortized O(N) scan every 16 messages instead of per-recv)
- Channel-based design supporting multiple subscribers across processes via anonymous file + mmap
- Permission model based on Unix file permissions (mode bits)
- Four registration commands: CREATE, ATTACH, DETACH, DESTROY
- Two new opcodes: IORING_OP_IPC_SEND and IORING_OP_IPC_RECV
- Targeted unicast send via sqe->file_index for subscriber ID
Benchmark results (VM, 32 vCPUs, 32 GB RAM):
Point-to-point latency (1 sender, 1 receiver, ns/msg):
Msg Size pipe unix sock shm+eventfd io_uring unicast -------- ---- --------- ----------- --------------- 64 B 212 436 222 632 256 B 240 845 216 597 1 KB 424 613 550 640 4 KB 673 1,326 350 848 16 KB 1,982 1,477 2,169 1,893 32 KB 4,777 3,667 2,443 3,185
For point-to-point, io_uring IPC is within 1.5-2.5x of pipe/shm for small messages due to the io_uring submission overhead. At 16-32 KB the copy cost dominates and all mechanisms converge.
Broadcast to 16 receivers (ns/msg, sender-side):
Msg Size pipe unix sock shm+eventfd io_uring bcast
-------- ------ --------- ----------- -------------- 64 B 28,550 32,504 5,970 5,674 256 B 27,588 34,777 5,429 6,600 1 KB 28,072 34,845 6,542 6,095 4 KB 37,277 46,154 11,520 6,367 16 KB 57,998 58,348 34,969 7,592 32 KB 89,404 83,496 93,082 8,202
The shared-ring broadcast architecture is the key differentiator: at 16 receivers with 32 KB messages, io_uring broadcast is 10.9x faster than pipe and 11.3x faster than shm+eventfd because data is written once to the shared ring rather than copied N times.
Scaling from 1 to 16 receivers (64 B messages):
Mechanism 1 recv 16 recv Degradation --------- ------ ------- ----------- pipe 212 28,550 135x unix sock 436 32,504 75x shm+eventfd 222 5,970 27x io_uring bcast 651 5,674 8.7x io_uring mcast 569 1,406 2.5x
Multicast sender throughput (ns/msg):
Msg Size 1 recv 2 recv 4 recv 8 recv 16 recv -------- ------ ------ ------ ------ ------- 64 B 569 557 726 916 1,406 4 KB 825 763 829 1,395 1,630 32 KB 3,067 3,107 3,218 3,576 4,415
Multicast scales nearly flat because the CAS producer only contends with the shared consumer.head, not with individual receivers.
Daniel Hodges (2):
io_uring: add high-performance IPC channel infrastructure selftests/ipc: Add io_uring IPC selftest
MAINTAINERS | 1 + include/linux/io_uring_types.h | 7 + include/uapi/linux/io_uring.h | 74 ++ io_uring/Kconfig | 14 + io_uring/Makefile | 1 + io_uring/io_uring.c | 6 + io_uring/ipc.c | 1002 ++++++++++++++++ io_uring/ipc.h | 161 +++ io_uring/opdef.c | 19 + io_uring/register.c | 25 + tools/testing/selftests/ipc/Makefile | 2 +- tools/testing/selftests/ipc/io_uring_ipc.c | 1265 ++++++++++++++++++++ 12 files changed, 2576 insertions(+), 1 deletion(-) create mode 100644 io_uring/ipc.c create mode 100644 io_uring/ipc.h create mode 100644 tools/testing/selftests/ipc/io_uring_ipc.c
--
2.52.0
RFC PATCH 2/2 selftests/ipc: Add io_uring IPC selftest
Add selftests for io_uring IPC channels. Tests cover send/recv, broadcast, detach, permission enforcement, ring full, message truncation, slot reuse, and cross-process operation.
--- MAINTAINERS | 1 + tools/testing/selftests/ipc/Makefile | 2 +- tools/testing/selftests/ipc/io_uring_ipc.c | 1265 ++++++++++++++++++++ 3 files changed, 1267 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/ipc/io_uring_ipc.c
MAINTAINERS +1 -0
@@ -13432,6 +13432,7 @@ F: include/trace/events/io_uring.h F: include/uapi/linux/io_uring.h F: include/uapi/linux/io_uring/ F: io_uring/ +F: tools/testing/selftests/ipc/io_uring_ipc* IO_URING ZCRX M: Pavel Begunkov <[email protected]>
tools/testing/selftests/ipc/Makefile +1 -1
@@ -12,7 +12,7 @@ endif CFLAGS += $(KHDR_INCLUDES) -TEST_GEN_PROGS := msgque +TEST_GEN_PROGS := msgque io_uring_ipc include ../lib.mk
tools/testing/selftests/ipc/io_uring_ipc.c new file +1265 -0
1,265 lines not on this page · raw message
Signature · 1 line
2.52.0
RFC PATCH 1/2 io_uring: add high-performance IPC channel infrastructure
In reply to Daniel HodgesAdd a new IPC mechanism built on top of io_uring for message passing between processes.
Features:
- Shared memory ring buffer for message data transfer
- RCU-based subscriber lookup on send/recv paths
- Broadcast mode (all subscribers receive each message)
- Channel-based design supporting multiple subscribers
- Permission checking modeled on Unix file permissions
- Anonymous file per channel for mmap support
Architecture:
- Two new io_uring opcodes: IPC_SEND and IPC_RECV
- Four new registration commands for channel lifecycle:
CREATE, ATTACH, DETACH, and BUFFERS (BUFFERS is a stub)
- Channels are identified by numeric ID or 64-bit key
- Data is copied between userspace and a kernel ring buffer via copy_from_user/copy_to_user
- Multicast (round-robin) flag is defined but not yet implemented
Send/recv hot path optimizations:
- Cache the descriptor array base pointer in struct io_ipc_channel to avoid recomputing it on every send/recv
- Use __copy_from_user_inatomic/__copy_to_user_inatomic with fallback to the standard copy variants
- Add prefetch/prefetchw hints for descriptor and data access
- In non-broadcast mode, wake only the first receiver instead of iterating all subscribers
- Simplify error handling in io_ipc_send() using inline returns
- Remove channel pointer caching in request structs, emptying the send and recv cleanup handlers
--- include/linux/io_uring_types.h | 7 + include/uapi/linux/io_uring.h | 74 +++ io_uring/Kconfig | 14 + io_uring/Makefile | 1 + io_uring/io_uring.c | 6 + io_uring/ipc.c | 1002 ++++++++++++++++++++++++++++++++ io_uring/ipc.h | 161 +++++ io_uring/opdef.c | 19 + io_uring/register.c | 25 + 9 files changed, 1309 insertions(+) create mode 100644 io_uring/ipc.c create mode 100644 io_uring/ipc.h
include/linux/io_uring_types.h +7 -0
@@ -435,6 +435,13 @@ struct io_ring_ctx {u32 pers_next;struct xarray personalities; +#ifdef CONFIG_IO_URING_IPC +/* IPC subscriber tracking - keyed by subscriber_id */ +struct xarray ipc_subscribers; +/* IPC channels created by this ring - keyed by channel_id */ +struct xarray ipc_channels; +#endif +/* hashed buffered write serialization */ struct io_wq_hash *hash_map;
include/uapi/linux/io_uring.h +74 -0
92 lines not on this page · raw message
io_uring/Kconfig +14 -0
@@ -14,3 +14,17 @@ config IO_URING_BPF def_bool y depends on BPF depends on NET + +config IO_URING_IPC + bool "io_uring IPC support" + depends on IO_URING + default y + help + Enable io_uring-based inter-process communication. + + This provides high-performance IPC channels that leverage + io_uring's shared memory infrastructure and async notification + model. Supports broadcast and multicast patterns with + zero-copy capabilities. + + If unsure, say Y.
io_uring/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_IO_URING) += io_uring.o opdef.o kbuf.o rsrc.o notif.o \ query.o obj-$(CONFIG_IO_URING_ZCRX) += zcrx.o +obj-$(CONFIG_IO_URING_IPC) += ipc.o obj-$(CONFIG_IO_WQ) += io-wq.o obj-$(CONFIG_FUTEX) += futex.o obj-$(CONFIG_EPOLL) += epoll.o
io_uring/io_uring.c +6 -0
@@ -87,6 +87,7 @@#include "msg_ring.h" #include "memmap.h" #include "zcrx.h" +#include "ipc.h" #include "timeout.h" #include "poll.h"
@@ -251,6 +252,10 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)init_waitqueue_head (&ctx->sqo_sq_wait);INIT_LIST_HEAD (&ctx->sqd_list);INIT_LIST_HEAD (&ctx->cq_overflow_list); +#ifdef CONFIG_IO_URING_IPC +xa_init (&ctx->ipc_subscribers); +xa_init (&ctx->ipc_channels); +#endif ret =io_alloc_cache_init (&ctx->apoll_cache,IO_POLL_ALLOC_CACHE_MAX ,sizeof (struct async_poll ),0 ); ret |= io_alloc_cache_init(&ctx->netmsg_cache, IO_ALLOC_CACHE_MAX,
@@ -2154,6 +2159,7 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)io_sqe_buffers_unregister (ctx);io_sqe_files_unregister (ctx);io_unregister_zcrx_ifqs (ctx); +io_ipc_ctx_cleanup (ctx);io_cqring_overflow_kill (ctx);io_eventfd_unregister (ctx);io_free_alloc_caches (ctx);
io_uring/ipc.c new file +1002 -0
1,002 lines not on this page · raw message
io_uring/ipc.h new file +161 -0
161 lines not on this page · raw message
io_uring/opdef.c +19 -0
@@ -38,6 +38,7 @@#include "futex.h" #include "truncate.h" #include "zcrx.h" +#include "ipc.h" static int io_no_issue (struct io_kiocb *req,unsigned int issue_flags) {
@@ -599,6 +600,18 @@ const struct io_issue_def io_issue_defs[] = { .prep = io_uring_cmd_prep, .issue = io_uring_cmd, }, + [IORING_OP_IPC_SEND] = { + .audit_skip = 1, + .async_size = sizeof(struct io_ipc_send), + .prep = io_ipc_send_prep, + .issue = io_ipc_send, + }, + [IORING_OP_IPC_RECV] = { + .audit_skip = 1, + .async_size = sizeof(struct io_ipc_recv), + .prep = io_ipc_recv_prep, + .issue = io_ipc_recv, + }, };const struct io_cold_def io_cold_defs[] = {
@@ -857,6 +870,12 @@ const struct io_cold_def io_cold_defs[] = { .sqe_copy = io_uring_cmd_sqe_copy, .cleanup = io_uring_cmd_cleanup, }, + [IORING_OP_IPC_SEND] = { + .name = "IPC_SEND", + }, + [IORING_OP_IPC_RECV] = { + .name = "IPC_RECV", + }, };const char *io_uring_get_opcode (u8 opcode)
io_uring/register.c +25 -0
@@ -34,6 +34,7 @@#include "zcrx.h" #include "query.h" #include "bpf_filter.h" +#include "ipc.h" #define IORING_MAX_RESTRICTIONS (IORING_RESTRICTION_LAST + \ IORING_REGISTER_LAST + IORING_OP_LAST)
@@ -930,6 +931,30 @@ static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,WRITE_ONCE (ctx->bpf_filters, ctx->restrictions.bpf_filters->filters);break ; +case IORING_REGISTER_IPC_CHANNEL_CREATE : + ret = -EINVAL ; +if (!arg || nr_args !=1 ) +break ; + ret =io_ipc_channel_create (ctx, arg); +break ; +case IORING_REGISTER_IPC_CHANNEL_ATTACH : + ret = -EINVAL ; +if (!arg || nr_args !=1 ) +break ; + ret =io_ipc_channel_attach (ctx, arg); +break ; +case IORING_REGISTER_IPC_CHANNEL_DETACH : + ret = -EINVAL ; +if (arg || !nr_args) +break ; + ret =io_ipc_channel_detach (ctx, nr_args); +break ; +case IORING_REGISTER_IPC_CHANNEL_DESTROY : + ret = -EINVAL ; +if (arg || !nr_args) +break ; + ret =io_ipc_channel_destroy (ctx, nr_args); +break ;default : ret = -EINVAL ;break ;
Signature · 1 line
2.52.0
kernel test robot
build botRe: [RFC PATCH 1/2] io_uring: add high-performance IPC channel infrastructure
kernel test robot noticed the following build errors:
Hi Daniel,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:
[auto build test ERROR on axboe/for-next]
[also build test ERROR on next-20260311]
[cannot apply to shuah-kselftest/next shuah-kselftest/fixes linus/master v7.0-rc3] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Hodges/io_uring-add-high-performance-IPC-channel-infrastructure/20260314-062737 base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next patch link: https://lore.kernel.org/r/20260313130739.23265-2-git%40danielhodges.dev patch subject: [RFC PATCH 1/2] io_uring: add high-performance IPC channel infrastructure config: nios2-allnoconfig (https://download.01.org/0day-ci/archive/20260314/[email protected]/config) compiler: nios2-linux-gcc (GCC) 11.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260314/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> io_uring/opdef.c:605:50: error: invalid application of 'sizeof' to incomplete type 'struct io_ipc_send'
605 | .async_size = sizeof(struct io_ipc_send),
| ^~~~~~
>> io_uring/opdef.c:606:43: error: 'io_ipc_send_prep' undeclared here (not in a function); did you mean 'io_ipc_send'?
606 | .prep = io_ipc_send_prep,
| ^~~~~~~~~~~~~~~~
| io_ipc_send
>> io_uring/opdef.c:607:43: error: 'io_ipc_send' undeclared here (not in a function)
607 | .issue = io_ipc_send,
| ^~~~~~~~~~~
>> io_uring/opdef.c:611:50: error: invalid application of 'sizeof' to incomplete type 'struct io_ipc_recv'
611 | .async_size = sizeof(struct io_ipc_recv),
| ^~~~~~
>> io_uring/opdef.c:612:43: error: 'io_ipc_recv_prep' undeclared here (not in a function); did you mean 'io_ipc_recv'?
612 | .prep = io_ipc_recv_prep,
| ^~~~~~~~~~~~~~~~
| io_ipc_recv
>> io_uring/opdef.c:613:43: error: 'io_ipc_recv' undeclared here (not in a function) 613 | .issue = io_ipc_recv,
| ^~~~~~~~~~~
vim +605 io_uring/opdef.c
54
55 const struct io_issue_def io_issue_defs[] = {
56 [IORING_OP_NOP] = {
57 .audit_skip = 1,
58 .iopoll = 1,
59 .prep = io_nop_prep,
60 .issue = io_nop,
61 },
62 [IORING_OP_READV] = {
63 .needs_file = 1,
64 .unbound_nonreg_file = 1,
65 .pollin = 1,
66 .buffer_select = 1,
67 .plug = 1,
68 .audit_skip = 1,
69 .ioprio = 1,
70 .iopoll = 1,
71 .iopoll_queue = 1,
72 .vectored = 1,
73 .async_size = sizeof(struct io_async_rw),
74 .prep = io_prep_readv,
75 .issue = io_read,
76 },
77 [IORING_OP_WRITEV] = {
78 .needs_file = 1,
79 .hash_reg_file = 1,
80 .unbound_nonreg_file = 1,
81 .pollout = 1,
82 .plug = 1,
83 .audit_skip = 1,
84 .ioprio = 1,
85 .iopoll = 1,
86 .iopoll_queue = 1,
87 .vectored = 1,
88 .async_size = sizeof(struct io_async_rw),
89 .prep = io_prep_writev,
90 .issue = io_write,
91 },
92 [IORING_OP_FSYNC] = {
93 .needs_file = 1,
94 .audit_skip = 1,
95 .prep = io_fsync_prep,
96 .issue = io_fsync,
97 },
98 [IORING_OP_READ_FIXED] = {
99 .needs_file = 1,
100 .unbound_nonreg_file = 1,
101 .pollin = 1,
102 .plug = 1,
103 .audit_skip = 1,
104 .ioprio = 1,
105 .iopoll = 1,
106 .iopoll_queue = 1,
107 .async_size = sizeof(struct io_async_rw),
108 .prep = io_prep_read_fixed,
109 .issue = io_read_fixed,
110 },
111 [IORING_OP_WRITE_FIXED] = {
112 .needs_file = 1,
113 .hash_reg_file = 1,
114 .unbound_nonreg_file = 1,
115 .pollout = 1,
116 .plug = 1,
117 .audit_skip = 1,
118 .ioprio = 1,
119 .iopoll = 1,
120 .iopoll_queue = 1,
121 .async_size = sizeof(struct io_async_rw),
122 .prep = io_prep_write_fixed,
123 .issue = io_write_fixed,
124 },
125 [IORING_OP_POLL_ADD] = {
126 .needs_file = 1,
127 .unbound_nonreg_file = 1,
128 .audit_skip = 1,
129 .prep = io_poll_add_prep,
130 .issue = io_poll_add,
131 },
132 [IORING_OP_POLL_REMOVE] = {
133 .audit_skip = 1,
134 .prep = io_poll_remove_prep,
135 .issue = io_poll_remove,
136 },
137 [IORING_OP_SYNC_FILE_RANGE] = {
138 .needs_file = 1,
139 .audit_skip = 1,
140 .prep = io_sfr_prep,
141 .issue = io_sync_file_range,
142 },
143 [IORING_OP_SENDMSG] = {
144 .needs_file = 1,
145 .unbound_nonreg_file = 1,
146 .pollout = 1,
147 .ioprio = 1,
148 #if defined(CONFIG_NET)
149 .async_size = sizeof(struct io_async_msghdr),
150 .prep = io_sendmsg_prep,
151 .issue = io_sendmsg,
152 #else
153 .prep = io_eopnotsupp_prep,
154 #endif
155 },
156 [IORING_OP_RECVMSG] = {
157 .needs_file = 1,
158 .unbound_nonreg_file = 1,
159 .pollin = 1,
160 .buffer_select = 1,
161 .ioprio = 1,
162 #if defined(CONFIG_NET)
163 .async_size = sizeof(struct io_async_msghdr),
164 .prep = io_recvmsg_prep,
165 .issue = io_recvmsg,
166 #else
167 .prep = io_eopnotsupp_prep,
168 #endif
169 },
170 [IORING_OP_TIMEOUT] = {
171 .audit_skip = 1,
172 .async_size = sizeof(struct io_timeout_data),
173 .prep = io_timeout_prep,
174 .issue = io_timeout,
175 },
176 [IORING_OP_TIMEOUT_REMOVE] = {
177 /* used by timeout updates' prep() */
178 .audit_skip = 1,
179 .prep = io_timeout_remove_prep,
180 .issue = io_timeout_remove,
181 },
182 [IORING_OP_ACCEPT] = {
183 .needs_file = 1,
184 .unbound_nonreg_file = 1,
185 .pollin = 1,
186 .poll_exclusive = 1,
187 .ioprio = 1, /* used for flags */
188 #if defined(CONFIG_NET)
189 .prep = io_accept_prep,
190 .issue = io_accept,
191 #else
192 .prep = io_eopnotsupp_prep,
193 #endif
194 },
195 [IORING_OP_ASYNC_CANCEL] = {
196 .audit_skip = 1,
197 .prep = io_async_cancel_prep,
198 .issue = io_async_cancel,
199 },
200 [IORING_OP_LINK_TIMEOUT] = {
201 .audit_skip = 1,
202 .async_size = sizeof(struct io_timeout_data),
203 .prep = io_link_timeout_prep,
204 .issue = io_no_issue,
205 },
206 [IORING_OP_CONNECT] = {
207 .needs_file = 1,
208 .unbound_nonreg_file = 1,
209 .pollout = 1,
210 #if defined(CONFIG_NET)
211 .async_size = sizeof(struct io_async_msghdr),
212 .prep = io_connect_prep,
213 .issue = io_connect,
214 #else
215 .prep = io_eopnotsupp_prep,
216 #endif
217 },
218 [IORING_OP_FALLOCATE] = {
219 .needs_file = 1,
220 .hash_reg_file = 1,
221 .prep = io_fallocate_prep,
222 .issue = io_fallocate,
223 },
224 [IORING_OP_OPENAT] = {
225 .filter_pdu_size = sizeof_field(struct io_uring_bpf_ctx, open),
226 .prep = io_openat_prep,
227 .issue = io_openat,
228 .filter_populate = io_openat_bpf_populate,
229 },
230 [IORING_OP_CLOSE] = {
231 .prep = io_close_prep,
232 .issue = io_close,
233 },
234 [IORING_OP_FILES_UPDATE] = {
235 .audit_skip = 1,
236 .iopoll = 1,
237 .prep = io_files_update_prep,
238 .issue = io_files_update,
239 },
240 [IORING_OP_STATX] = {
241 .audit_skip = 1,
242 .prep = io_statx_prep,
243 .issue = io_statx,
244 },
245 [IORING_OP_READ] = {
246 .needs_file = 1,
247 .unbound_nonreg_file = 1,
248 .pollin = 1,
249 .buffer_select = 1,
250 .plug = 1,
251 .audit_skip = 1,
252 .ioprio = 1,
253 .iopoll = 1,
254 .iopoll_queue = 1,
255 .async_size = sizeof(struct io_async_rw),
256 .prep = io_prep_read,
257 .issue = io_read,
258 },
259 [IORING_OP_WRITE] = {
260 .needs_file = 1,
261 .hash_reg_file = 1,
262 .unbound_nonreg_file = 1,
263 .pollout = 1,
264 .plug = 1,
265 .audit_skip = 1,
266 .ioprio = 1,
267 .iopoll = 1,
268 .iopoll_queue = 1,
269 .async_size = sizeof(struct io_async_rw),
270 .prep = io_prep_write,
271 .issue = io_write,
272 },
273 [IORING_OP_FADVISE] = {
274 .needs_file = 1,
275 .audit_skip = 1,
276 .prep = io_fadvise_prep,
277 .issue = io_fadvise,
278 },
279 [IORING_OP_MADVISE] = {
280 .audit_skip = 1,
281 .prep = io_madvise_prep,
282 .issue = io_madvise,
283 },
284 [IORING_OP_SEND] = {
285 .needs_file = 1,
286 .unbound_nonreg_file = 1,
287 .pollout = 1,
288 .audit_skip = 1,
289 .ioprio = 1,
290 .buffer_select = 1,
291 #if defined(CONFIG_NET)
292 .async_size = sizeof(struct io_async_msghdr),
293 .prep = io_sendmsg_prep,
294 .issue = io_send,
295 #else
296 .prep = io_eopnotsupp_prep,
297 #endif
298 },
299 [IORING_OP_RECV] = {
300 .needs_file = 1,
301 .unbound_nonreg_file = 1,
302 .pollin = 1,
303 .buffer_select = 1,
304 .audit_skip = 1,
305 .ioprio = 1,
306 #if defined(CONFIG_NET)
307 .async_size = sizeof(struct io_async_msghdr),
308 .prep = io_recvmsg_prep,
309 .issue = io_recv,
310 #else
311 .prep = io_eopnotsupp_prep,
312 #endif
313 },
314 [IORING_OP_OPENAT2] = {
315 .filter_pdu_size = sizeof_field(struct io_uring_bpf_ctx, open),
316 .prep = io_openat2_prep,
317 .issue = io_openat2,
318 .filter_populate = io_openat_bpf_populate,
319 },
320 [IORING_OP_EPOLL_CTL] = {
321 .unbound_nonreg_file = 1,
322 .audit_skip = 1,
323 #if defined(CONFIG_EPOLL)
324 .prep = io_epoll_ctl_prep,
325 .issue = io_epoll_ctl,
326 #else
327 .prep = io_eopnotsupp_prep,
328 #endif
329 },
330 [IORING_OP_SPLICE] = {
331 .needs_file = 1,
332 .hash_reg_file = 1,
333 .unbound_nonreg_file = 1,
334 .audit_skip = 1,
335 .prep = io_splice_prep,
336 .issue = io_splice,
337 },
338 [IORING_OP_PROVIDE_BUFFERS] = {
339 .audit_skip = 1,
340 .iopoll = 1,
341 .prep = io_provide_buffers_prep,
342 .issue = io_manage_buffers_legacy,
343 },
344 [IORING_OP_REMOVE_BUFFERS] = {
345 .audit_skip = 1,
346 .iopoll = 1,
347 .prep = io_remove_buffers_prep,
348 .issue = io_manage_buffers_legacy,
349 },
350 [IORING_OP_TEE] = {
351 .needs_file = 1,
352 .hash_reg_file = 1,
353 .unbound_nonreg_file = 1,
354 .audit_skip = 1,
355 .prep = io_tee_prep,
356 .issue = io_tee,
357 },
358 [IORING_OP_SHUTDOWN] = {
359 .needs_file = 1,
360 #if defined(CONFIG_NET)
361 .prep = io_shutdown_prep,
362 .issue = io_shutdown,
363 #else
364 .prep = io_eopnotsupp_prep,
365 #endif
366 },
367 [IORING_OP_RENAMEAT] = {
368 .prep = io_renameat_prep,
369 .issue = io_renameat,
370 },
371 [IORING_OP_UNLINKAT] = {
372 .prep = io_unlinkat_prep,
373 .issue = io_unlinkat,
374 },
375 [IORING_OP_MKDIRAT] = {
376 .prep = io_mkdirat_prep,
377 .issue = io_mkdirat,
378 },
379 [IORING_OP_SYMLINKAT] = {
380 .prep = io_symlinkat_prep,
381 .issue = io_symlinkat,
382 },
383 [IORING_OP_LINKAT] = {
384 .prep = io_linkat_prep,
385 .issue = io_linkat,
386 },
387 [IORING_OP_MSG_RING] = {
388 .needs_file = 1,
389 .iopoll = 1,
390 .prep = io_msg_ring_prep,
391 .issue = io_msg_ring,
392 },
393 [IORING_OP_FSETXATTR] = {
394 .needs_file = 1,
395 .prep = io_fsetxattr_prep,
396 .issue = io_fsetxattr,
397 },
398 [IORING_OP_SETXATTR] = {
399 .prep = io_setxattr_prep,
400 .issue = io_setxattr,
401 },
402 [IORING_OP_FGETXATTR] = {
403 .needs_file = 1,
404 .prep = io_fgetxattr_prep,
405 .issue = io_fgetxattr,
406 },
407 [IORING_OP_GETXATTR] = {
408 .prep = io_getxattr_prep,
409 .issue = io_getxattr,
410 },
411 [IORING_OP_SOCKET] = {
412 .audit_skip = 1,
413 #if defined(CONFIG_NET)
414 .filter_pdu_size = sizeof_field(struct io_uring_bpf_ctx, socket),
415 .prep = io_socket_prep,
416 .issue = io_socket,
417 .filter_populate = io_socket_bpf_populate,
418 #else
419 .prep = io_eopnotsupp_prep,
420 #endif
421 },
422 [IORING_OP_URING_CMD] = {
423 .buffer_select = 1,
424 .needs_file = 1,
425 .plug = 1,
426 .iopoll = 1,
427 .iopoll_queue = 1,
428 .async_size = sizeof(struct io_async_cmd),
429 .prep = io_uring_cmd_prep,
430 .issue = io_uring_cmd,
431 },
432 [IORING_OP_SEND_ZC] = {
433 .needs_file = 1,
434 .unbound_nonreg_file = 1,
435 .pollout = 1,
436 .audit_skip = 1,
437 .ioprio = 1,
438 #if defined(CONFIG_NET)
439 .async_size = sizeof(struct io_async_msghdr),
440 .prep = io_send_zc_prep,
441 .issue = io_sendmsg_zc,
442 #else
443 .prep = io_eopnotsupp_prep,
444 #endif
445 },
446 [IORING_OP_SENDMSG_ZC] = {
447 .needs_file = 1,
448 .unbound_nonreg_file = 1,
449 .pollout = 1,
450 .ioprio = 1,
451 #if defined(CONFIG_NET)
452 .async_size = sizeof(struct io_async_msghdr),
453 .prep = io_send_zc_prep,
454 .issue = io_sendmsg_zc,
455 #else
456 .prep = io_eopnotsupp_prep,
457 #endif
458 },
459 [IORING_OP_READ_MULTISHOT] = {
460 .needs_file = 1,
461 .unbound_nonreg_file = 1,
462 .pollin = 1,
463 .buffer_select = 1,
464 .audit_skip = 1,
465 .async_size = sizeof(struct io_async_rw),
466 .prep = io_read_mshot_prep,
467 .issue = io_read_mshot,
468 },
469 [IORING_OP_WAITID] = {
470 .async_size = sizeof(struct io_waitid_async),
471 .prep = io_waitid_prep,
472 .issue = io_waitid,
473 },
474 [IORING_OP_FUTEX_WAIT] = {
475 #if defined(CONFIG_FUTEX)
476 .prep = io_futex_prep,
477 .issue = io_futex_wait,
478 #else
479 .prep = io_eopnotsupp_prep,
480 #endif
481 },
482 [IORING_OP_FUTEX_WAKE] = {
483 #if defined(CONFIG_FUTEX)
484 .prep = io_futex_prep,
485 .issue = io_futex_wake,
486 #else
487 .prep = io_eopnotsupp_prep,
488 #endif
489 },
490 [IORING_OP_FUTEX_WAITV] = {
491 #if defined(CONFIG_FUTEX)
492 .prep = io_futexv_prep,
493 .issue = io_futexv_wait,
494 #else
495 .prep = io_eopnotsupp_prep,
496 #endif
497 },
498 [IORING_OP_FIXED_FD_INSTALL] = {
499 .needs_file = 1,
500 .prep = io_install_fixed_fd_prep,
501 .issue = io_install_fixed_fd,
502 },
503 [IORING_OP_FTRUNCATE] = {
504 .needs_file = 1,
505 .hash_reg_file = 1,
506 .prep = io_ftruncate_prep,
507 .issue = io_ftruncate,
508 },
509 [IORING_OP_BIND] = {
510 #if defined(CONFIG_NET)
511 .needs_file = 1,
512 .prep = io_bind_prep,
513 .issue = io_bind,
514 .async_size = sizeof(struct io_async_msghdr),
515 #else
516 .prep = io_eopnotsupp_prep,
517 #endif
518 },
519 [IORING_OP_LISTEN] = {
520 #if defined(CONFIG_NET)
521 .needs_file = 1,
522 .prep = io_listen_prep,
523 .issue = io_listen,
524 .async_size = sizeof(struct io_async_msghdr),
525 #else
526 .prep = io_eopnotsupp_prep,
527 #endif
528 },
529 [IORING_OP_RECV_ZC] = {
530 .needs_file = 1,
531 .unbound_nonreg_file = 1,
532 .pollin = 1,
533 .ioprio = 1,
534 #if defined(CONFIG_NET)
535 .prep = io_recvzc_prep,
536 .issue = io_recvzc,
537 #else
538 .prep = io_eopnotsupp_prep,
539 #endif
540 },
541 [IORING_OP_EPOLL_WAIT] = {
542 .needs_file = 1,
543 .audit_skip = 1,
544 .pollin = 1,
545 #if defined(CONFIG_EPOLL)
546 .prep = io_epoll_wait_prep,
547 .issue = io_epoll_wait,
548 #else
549 .prep = io_eopnotsupp_prep,
550 #endif
551 },
552 [IORING_OP_READV_FIXED] = {
553 .needs_file = 1,
554 .unbound_nonreg_file = 1,
555 .pollin = 1,
556 .plug = 1,
557 .audit_skip = 1,
558 .ioprio = 1,
559 .iopoll = 1,
560 .iopoll_queue = 1,
561 .vectored = 1,
562 .async_size = sizeof(struct io_async_rw),
563 .prep = io_prep_readv_fixed,
564 .issue = io_read,
565 },
566 [IORING_OP_WRITEV_FIXED] = {
567 .needs_file = 1,
568 .hash_reg_file = 1,
569 .unbound_nonreg_file = 1,
570 .pollout = 1,
571 .plug = 1,
572 .audit_skip = 1,
573 .ioprio = 1,
574 .iopoll = 1,
575 .iopoll_queue = 1,
576 .vectored = 1,
577 .async_size = sizeof(struct io_async_rw),
578 .prep = io_prep_writev_fixed,
579 .issue = io_write,
580 },
581 [IORING_OP_PIPE] = {
582 .prep = io_pipe_prep,
583 .issue = io_pipe,
584 },
585 [IORING_OP_NOP128] = {
586 .audit_skip = 1,
587 .iopoll = 1,
588 .is_128 = 1,
589 .prep = io_nop_prep,
590 .issue = io_nop,
591 },
592 [IORING_OP_URING_CMD128] = {
593 .buffer_select = 1,
594 .needs_file = 1,
595 .plug = 1,
596 .iopoll = 1,
597 .iopoll_queue = 1,
598 .is_128 = 1,
599 .async_size = sizeof(struct io_async_cmd),
600 .prep = io_uring_cmd_prep,
601 .issue = io_uring_cmd,
602 },
603 [IORING_OP_IPC_SEND] = {
604 .audit_skip = 1,
> 605 .async_size = sizeof(struct io_ipc_send),
> 606 .prep = io_ipc_send_prep,
> 607 .issue = io_ipc_send,
608 },
609 [IORING_OP_IPC_RECV] = {
610 .audit_skip = 1,
> 611 .async_size = sizeof(struct io_ipc_recv),
> 612 .prep = io_ipc_recv_prep,
> 613 .issue = io_ipc_recv, 614 },
615 };
616
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [RFC PATCH 1/2] io_uring: add high-performance IPC channel infrastructure
In reply to Daniel Hodgeskernel test robot noticed the following build errors:
Hi Daniel,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:
[auto build test ERROR on axboe/for-next]
[also build test ERROR on next-20260311]
[cannot apply to shuah-kselftest/next shuah-kselftest/fixes linus/master v7.0-rc3] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Hodges/io_uring-add-high-performance-IPC-channel-infrastructure/20260314-062737 base: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git for-next patch link: https://lore.kernel.org/r/20260313130739.23265-2-git%40danielhodges.dev patch subject: [RFC PATCH 1/2] io_uring: add high-performance IPC channel infrastructure config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20260314/[email protected]/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260314/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> io_uring/opdef.c:605:18: error: invalid application of 'sizeof' to an incomplete type 'struct io_ipc_send'
605 | .async_size = sizeof(struct io_ipc_send),
| ^ ~~~~~~~~~~~~~~~~~~~~
io_uring/opdef.c:605:32: note: forward declaration of 'struct io_ipc_send'
605 | .async_size = sizeof(struct io_ipc_send),
| ^
>> io_uring/opdef.c:606:13: error: use of undeclared identifier 'io_ipc_send_prep'
606 | .prep = io_ipc_send_prep,
| ^
>> io_uring/opdef.c:607:14: error: use of undeclared identifier 'io_ipc_send'
607 | .issue = io_ipc_send,
| ^
>> io_uring/opdef.c:611:18: error: invalid application of 'sizeof' to an incomplete type 'struct io_ipc_recv'
611 | .async_size = sizeof(struct io_ipc_recv),
| ^ ~~~~~~~~~~~~~~~~~~~~
io_uring/opdef.c:611:32: note: forward declaration of 'struct io_ipc_recv'
611 | .async_size = sizeof(struct io_ipc_recv),
| ^
>> io_uring/opdef.c:612:13: error: use of undeclared identifier 'io_ipc_recv_prep'
612 | .prep = io_ipc_recv_prep,
| ^
>> io_uring/opdef.c:613:14: error: use of undeclared identifier 'io_ipc_recv'; did you mean 'io_zcrx_recv'?
613 | .issue = io_ipc_recv,
| ^~~~~~~~~~~
| io_zcrx_recv
io_uring/zcrx.h:91:19: note: 'io_zcrx_recv' declared here
91 | static inline int io_zcrx_recv(struct io_kiocb *req, struct io_zcrx_ifq *ifq,
| ^
>> io_uring/opdef.c:901:15: error: invalid application of 'sizeof' to an incomplete type 'const struct io_issue_def[]'
901 | BUILD_BUG_ON(ARRAY_SIZE(io_issue_defs) != IORING_OP_LAST);
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/array_size.h:11:32: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^
include/linux/build_bug.h:50:19: note: expanded from macro 'BUILD_BUG_ON'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
include/linux/compiler_types.h:706:22: note: expanded from macro 'compiletime_assert'
706 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:694:23: note: expanded from macro '_compiletime_assert'
694 | __compiletime_assert(condition, msg, prefix, suffix)
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:686:9: note: expanded from macro '__compiletime_assert'
686 | if (!(condition)) \
| ^~~~~~~~~
io_uring/opdef.c:903:18: error: invalid application of 'sizeof' to an incomplete type 'const struct io_issue_def[]'
903 | for (i = 0; i < ARRAY_SIZE(io_issue_defs); i++) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/array_size.h:11:32: note: expanded from macro 'ARRAY_SIZE'
11 | #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
| ^~~~~8 errors generated.
vim +605 io_uring/opdef.c
54
55 const struct io_issue_def io_issue_defs[] = {
56 [IORING_OP_NOP] = {
57 .audit_skip = 1,
58 .iopoll = 1,
59 .prep = io_nop_prep,
60 .issue = io_nop,
61 },
62 [IORING_OP_READV] = {
63 .needs_file = 1,
64 .unbound_nonreg_file = 1,
65 .pollin = 1,
66 .buffer_select = 1,
67 .plug = 1,
68 .audit_skip = 1,
69 .ioprio = 1,
70 .iopoll = 1,
71 .iopoll_queue = 1,
72 .vectored = 1,
73 .async_size = sizeof(struct io_async_rw),
74 .prep = io_prep_readv,
75 .issue = io_read,
76 },
77 [IORING_OP_WRITEV] = {
78 .needs_file = 1,
79 .hash_reg_file = 1,
80 .unbound_nonreg_file = 1,
81 .pollout = 1,
82 .plug = 1,
83 .audit_skip = 1,
84 .ioprio = 1,
85 .iopoll = 1,
86 .iopoll_queue = 1,
87 .vectored = 1,
88 .async_size = sizeof(struct io_async_rw),
89 .prep = io_prep_writev,
90 .issue = io_write,
91 },
92 [IORING_OP_FSYNC] = {
93 .needs_file = 1,
94 .audit_skip = 1,
95 .prep = io_fsync_prep,
96 .issue = io_fsync,
97 },
98 [IORING_OP_READ_FIXED] = {
99 .needs_file = 1,
100 .unbound_nonreg_file = 1,
101 .pollin = 1,
102 .plug = 1,
103 .audit_skip = 1,
104 .ioprio = 1,
105 .iopoll = 1,
106 .iopoll_queue = 1,
107 .async_size = sizeof(struct io_async_rw),
108 .prep = io_prep_read_fixed,
109 .issue = io_read_fixed,
110 },
111 [IORING_OP_WRITE_FIXED] = {
112 .needs_file = 1,
113 .hash_reg_file = 1,
114 .unbound_nonreg_file = 1,
115 .pollout = 1,
116 .plug = 1,
117 .audit_skip = 1,
118 .ioprio = 1,
119 .iopoll = 1,
120 .iopoll_queue = 1,
121 .async_size = sizeof(struct io_async_rw),
122 .prep = io_prep_write_fixed,
123 .issue = io_write_fixed,
124 },
125 [IORING_OP_POLL_ADD] = {
126 .needs_file = 1,
127 .unbound_nonreg_file = 1,
128 .audit_skip = 1,
129 .prep = io_poll_add_prep,
130 .issue = io_poll_add,
131 },
132 [IORING_OP_POLL_REMOVE] = {
133 .audit_skip = 1,
134 .prep = io_poll_remove_prep,
135 .issue = io_poll_remove,
136 },
137 [IORING_OP_SYNC_FILE_RANGE] = {
138 .needs_file = 1,
139 .audit_skip = 1,
140 .prep = io_sfr_prep,
141 .issue = io_sync_file_range,
142 },
143 [IORING_OP_SENDMSG] = {
144 .needs_file = 1,
145 .unbound_nonreg_file = 1,
146 .pollout = 1,
147 .ioprio = 1,
148 #if defined(CONFIG_NET)
149 .async_size = sizeof(struct io_async_msghdr),
150 .prep = io_sendmsg_prep,
151 .issue = io_sendmsg,
152 #else
153 .prep = io_eopnotsupp_prep,
154 #endif
155 },
156 [IORING_OP_RECVMSG] = {
157 .needs_file = 1,
158 .unbound_nonreg_file = 1,
159 .pollin = 1,
160 .buffer_select = 1,
161 .ioprio = 1,
162 #if defined(CONFIG_NET)
163 .async_size = sizeof(struct io_async_msghdr),
164 .prep = io_recvmsg_prep,
165 .issue = io_recvmsg,
166 #else
167 .prep = io_eopnotsupp_prep,
168 #endif
169 },
170 [IORING_OP_TIMEOUT] = {
171 .audit_skip = 1,
172 .async_size = sizeof(struct io_timeout_data),
173 .prep = io_timeout_prep,
174 .issue = io_timeout,
175 },
176 [IORING_OP_TIMEOUT_REMOVE] = {
177 /* used by timeout updates' prep() */
178 .audit_skip = 1,
179 .prep = io_timeout_remove_prep,
180 .issue = io_timeout_remove,
181 },
182 [IORING_OP_ACCEPT] = {
183 .needs_file = 1,
184 .unbound_nonreg_file = 1,
185 .pollin = 1,
186 .poll_exclusive = 1,
187 .ioprio = 1, /* used for flags */
188 #if defined(CONFIG_NET)
189 .prep = io_accept_prep,
190 .issue = io_accept,
191 #else
192 .prep = io_eopnotsupp_prep,
193 #endif
194 },
195 [IORING_OP_ASYNC_CANCEL] = {
196 .audit_skip = 1,
197 .prep = io_async_cancel_prep,
198 .issue = io_async_cancel,
199 },
200 [IORING_OP_LINK_TIMEOUT] = {
201 .audit_skip = 1,
202 .async_size = sizeof(struct io_timeout_data),
203 .prep = io_link_timeout_prep,
204 .issue = io_no_issue,
205 },
206 [IORING_OP_CONNECT] = {
207 .needs_file = 1,
208 .unbound_nonreg_file = 1,
209 .pollout = 1,
210 #if defined(CONFIG_NET)
211 .async_size = sizeof(struct io_async_msghdr),
212 .prep = io_connect_prep,
213 .issue = io_connect,
214 #else
215 .prep = io_eopnotsupp_prep,
216 #endif
217 },
218 [IORING_OP_FALLOCATE] = {
219 .needs_file = 1,
220 .hash_reg_file = 1,
221 .prep = io_fallocate_prep,
222 .issue = io_fallocate,
223 },
224 [IORING_OP_OPENAT] = {
225 .filter_pdu_size = sizeof_field(struct io_uring_bpf_ctx, open),
226 .prep = io_openat_prep,
227 .issue = io_openat,
228 .filter_populate = io_openat_bpf_populate,
229 },
230 [IORING_OP_CLOSE] = {
231 .prep = io_close_prep,
232 .issue = io_close,
233 },
234 [IORING_OP_FILES_UPDATE] = {
235 .audit_skip = 1,
236 .iopoll = 1,
237 .prep = io_files_update_prep,
238 .issue = io_files_update,
239 },
240 [IORING_OP_STATX] = {
241 .audit_skip = 1,
242 .prep = io_statx_prep,
243 .issue = io_statx,
244 },
245 [IORING_OP_READ] = {
246 .needs_file = 1,
247 .unbound_nonreg_file = 1,
248 .pollin = 1,
249 .buffer_select = 1,
250 .plug = 1,
251 .audit_skip = 1,
252 .ioprio = 1,
253 .iopoll = 1,
254 .iopoll_queue = 1,
255 .async_size = sizeof(struct io_async_rw),
256 .prep = io_prep_read,
257 .issue = io_read,
258 },
259 [IORING_OP_WRITE] = {
260 .needs_file = 1,
261 .hash_reg_file = 1,
262 .unbound_nonreg_file = 1,
263 .pollout = 1,
264 .plug = 1,
265 .audit_skip = 1,
266 .ioprio = 1,
267 .iopoll = 1,
268 .iopoll_queue = 1,
269 .async_size = sizeof(struct io_async_rw),
270 .prep = io_prep_write,
271 .issue = io_write,
272 },
273 [IORING_OP_FADVISE] = {
274 .needs_file = 1,
275 .audit_skip = 1,
276 .prep = io_fadvise_prep,
277 .issue = io_fadvise,
278 },
279 [IORING_OP_MADVISE] = {
280 .audit_skip = 1,
281 .prep = io_madvise_prep,
282 .issue = io_madvise,
283 },
284 [IORING_OP_SEND] = {
285 .needs_file = 1,
286 .unbound_nonreg_file = 1,
287 .pollout = 1,
288 .audit_skip = 1,
289 .ioprio = 1,
290 .buffer_select = 1,
291 #if defined(CONFIG_NET)
292 .async_size = sizeof(struct io_async_msghdr),
293 .prep = io_sendmsg_prep,
294 .issue = io_send,
295 #else
296 .prep = io_eopnotsupp_prep,
297 #endif
298 },
299 [IORING_OP_RECV] = {
300 .needs_file = 1,
301 .unbound_nonreg_file = 1,
302 .pollin = 1,
303 .buffer_select = 1,
304 .audit_skip = 1,
305 .ioprio = 1,
306 #if defined(CONFIG_NET)
307 .async_size = sizeof(struct io_async_msghdr),
308 .prep = io_recvmsg_prep,
309 .issue = io_recv,
310 #else
311 .prep = io_eopnotsupp_prep,
312 #endif
313 },
314 [IORING_OP_OPENAT2] = {
315 .filter_pdu_size = sizeof_field(struct io_uring_bpf_ctx, open),
316 .prep = io_openat2_prep,
317 .issue = io_openat2,
318 .filter_populate = io_openat_bpf_populate,
319 },
320 [IORING_OP_EPOLL_CTL] = {
321 .unbound_nonreg_file = 1,
322 .audit_skip = 1,
323 #if defined(CONFIG_EPOLL)
324 .prep = io_epoll_ctl_prep,
325 .issue = io_epoll_ctl,
326 #else
327 .prep = io_eopnotsupp_prep,
328 #endif
329 },
330 [IORING_OP_SPLICE] = {
331 .needs_file = 1,
332 .hash_reg_file = 1,
333 .unbound_nonreg_file = 1,
334 .audit_skip = 1,
335 .prep = io_splice_prep,
336 .issue = io_splice,
337 },
338 [IORING_OP_PROVIDE_BUFFERS] = {
339 .audit_skip = 1,
340 .iopoll = 1,
341 .prep = io_provide_buffers_prep,
342 .issue = io_manage_buffers_legacy,
343 },
344 [IORING_OP_REMOVE_BUFFERS] = {
345 .audit_skip = 1,
346 .iopoll = 1,
347 .prep = io_remove_buffers_prep,
348 .issue = io_manage_buffers_legacy,
349 },
350 [IORING_OP_TEE] = {
351 .needs_file = 1,
352 .hash_reg_file = 1,
353 .unbound_nonreg_file = 1,
354 .audit_skip = 1,
355 .prep = io_tee_prep,
356 .issue = io_tee,
357 },
358 [IORING_OP_SHUTDOWN] = {
359 .needs_file = 1,
360 #if defined(CONFIG_NET)
361 .prep = io_shutdown_prep,
362 .issue = io_shutdown,
363 #else
364 .prep = io_eopnotsupp_prep,
365 #endif
366 },
367 [IORING_OP_RENAMEAT] = {
368 .prep = io_renameat_prep,
369 .issue = io_renameat,
370 },
371 [IORING_OP_UNLINKAT] = {
372 .prep = io_unlinkat_prep,
373 .issue = io_unlinkat,
374 },
375 [IORING_OP_MKDIRAT] = {
376 .prep = io_mkdirat_prep,
377 .issue = io_mkdirat,
378 },
379 [IORING_OP_SYMLINKAT] = {
380 .prep = io_symlinkat_prep,
381 .issue = io_symlinkat,
382 },
383 [IORING_OP_LINKAT] = {
384 .prep = io_linkat_prep,
385 .issue = io_linkat,
386 },
387 [IORING_OP_MSG_RING] = {
388 .needs_file = 1,
389 .iopoll = 1,
390 .prep = io_msg_ring_prep,
391 .issue = io_msg_ring,
392 },
393 [IORING_OP_FSETXATTR] = {
394 .needs_file = 1,
395 .prep = io_fsetxattr_prep,
396 .issue = io_fsetxattr,
397 },
398 [IORING_OP_SETXATTR] = {
399 .prep = io_setxattr_prep,
400 .issue = io_setxattr,
401 },
402 [IORING_OP_FGETXATTR] = {
403 .needs_file = 1,
404 .prep = io_fgetxattr_prep,
405 .issue = io_fgetxattr,
406 },
407 [IORING_OP_GETXATTR] = {
408 .prep = io_getxattr_prep,
409 .issue = io_getxattr,
410 },
411 [IORING_OP_SOCKET] = {
412 .audit_skip = 1,
413 #if defined(CONFIG_NET)
414 .filter_pdu_size = sizeof_field(struct io_uring_bpf_ctx, socket),
415 .prep = io_socket_prep,
416 .issue = io_socket,
417 .filter_populate = io_socket_bpf_populate,
418 #else
419 .prep = io_eopnotsupp_prep,
420 #endif
421 },
422 [IORING_OP_URING_CMD] = {
423 .buffer_select = 1,
424 .needs_file = 1,
425 .plug = 1,
426 .iopoll = 1,
427 .iopoll_queue = 1,
428 .async_size = sizeof(struct io_async_cmd),
429 .prep = io_uring_cmd_prep,
430 .issue = io_uring_cmd,
431 },
432 [IORING_OP_SEND_ZC] = {
433 .needs_file = 1,
434 .unbound_nonreg_file = 1,
435 .pollout = 1,
436 .audit_skip = 1,
437 .ioprio = 1,
438 #if defined(CONFIG_NET)
439 .async_size = sizeof(struct io_async_msghdr),
440 .prep = io_send_zc_prep,
441 .issue = io_sendmsg_zc,
442 #else
443 .prep = io_eopnotsupp_prep,
444 #endif
445 },
446 [IORING_OP_SENDMSG_ZC] = {
447 .needs_file = 1,
448 .unbound_nonreg_file = 1,
449 .pollout = 1,
450 .ioprio = 1,
451 #if defined(CONFIG_NET)
452 .async_size = sizeof(struct io_async_msghdr),
453 .prep = io_send_zc_prep,
454 .issue = io_sendmsg_zc,
455 #else
456 .prep = io_eopnotsupp_prep,
457 #endif
458 },
459 [IORING_OP_READ_MULTISHOT] = {
460 .needs_file = 1,
461 .unbound_nonreg_file = 1,
462 .pollin = 1,
463 .buffer_select = 1,
464 .audit_skip = 1,
465 .async_size = sizeof(struct io_async_rw),
466 .prep = io_read_mshot_prep,
467 .issue = io_read_mshot,
468 },
469 [IORING_OP_WAITID] = {
470 .async_size = sizeof(struct io_waitid_async),
471 .prep = io_waitid_prep,
472 .issue = io_waitid,
473 },
474 [IORING_OP_FUTEX_WAIT] = {
475 #if defined(CONFIG_FUTEX)
476 .prep = io_futex_prep,
477 .issue = io_futex_wait,
478 #else
479 .prep = io_eopnotsupp_prep,
480 #endif
481 },
482 [IORING_OP_FUTEX_WAKE] = {
483 #if defined(CONFIG_FUTEX)
484 .prep = io_futex_prep,
485 .issue = io_futex_wake,
486 #else
487 .prep = io_eopnotsupp_prep,
488 #endif
489 },
490 [IORING_OP_FUTEX_WAITV] = {
491 #if defined(CONFIG_FUTEX)
492 .prep = io_futexv_prep,
493 .issue = io_futexv_wait,
494 #else
495 .prep = io_eopnotsupp_prep,
496 #endif
497 },
498 [IORING_OP_FIXED_FD_INSTALL] = {
499 .needs_file = 1,
500 .prep = io_install_fixed_fd_prep,
501 .issue = io_install_fixed_fd,
502 },
503 [IORING_OP_FTRUNCATE] = {
504 .needs_file = 1,
505 .hash_reg_file = 1,
506 .prep = io_ftruncate_prep,
507 .issue = io_ftruncate,
508 },
509 [IORING_OP_BIND] = {
510 #if defined(CONFIG_NET)
511 .needs_file = 1,
512 .prep = io_bind_prep,
513 .issue = io_bind,
514 .async_size = sizeof(struct io_async_msghdr),
515 #else
516 .prep = io_eopnotsupp_prep,
517 #endif
518 },
519 [IORING_OP_LISTEN] = {
520 #if defined(CONFIG_NET)
521 .needs_file = 1,
522 .prep = io_listen_prep,
523 .issue = io_listen,
524 .async_size = sizeof(struct io_async_msghdr),
525 #else
526 .prep = io_eopnotsupp_prep,
527 #endif
528 },
529 [IORING_OP_RECV_ZC] = {
530 .needs_file = 1,
531 .unbound_nonreg_file = 1,
532 .pollin = 1,
533 .ioprio = 1,
534 #if defined(CONFIG_NET)
535 .prep = io_recvzc_prep,
536 .issue = io_recvzc,
537 #else
538 .prep = io_eopnotsupp_prep,
539 #endif
540 },
541 [IORING_OP_EPOLL_WAIT] = {
542 .needs_file = 1,
543 .audit_skip = 1,
544 .pollin = 1,
545 #if defined(CONFIG_EPOLL)
546 .prep = io_epoll_wait_prep,
547 .issue = io_epoll_wait,
548 #else
549 .prep = io_eopnotsupp_prep,
550 #endif
551 },
552 [IORING_OP_READV_FIXED] = {
553 .needs_file = 1,
554 .unbound_nonreg_file = 1,
555 .pollin = 1,
556 .plug = 1,
557 .audit_skip = 1,
558 .ioprio = 1,
559 .iopoll = 1,
560 .iopoll_queue = 1,
561 .vectored = 1,
562 .async_size = sizeof(struct io_async_rw),
563 .prep = io_prep_readv_fixed,
564 .issue = io_read,
565 },
566 [IORING_OP_WRITEV_FIXED] = {
567 .needs_file = 1,
568 .hash_reg_file = 1,
569 .unbound_nonreg_file = 1,
570 .pollout = 1,
571 .plug = 1,
572 .audit_skip = 1,
573 .ioprio = 1,
574 .iopoll = 1,
575 .iopoll_queue = 1,
576 .vectored = 1,
577 .async_size = sizeof(struct io_async_rw),
578 .prep = io_prep_writev_fixed,
579 .issue = io_write,
580 },
581 [IORING_OP_PIPE] = {
582 .prep = io_pipe_prep,
583 .issue = io_pipe,
584 },
585 [IORING_OP_NOP128] = {
586 .audit_skip = 1,
587 .iopoll = 1,
588 .is_128 = 1,
589 .prep = io_nop_prep,
590 .issue = io_nop,
591 },
592 [IORING_OP_URING_CMD128] = {
593 .buffer_select = 1,
594 .needs_file = 1,
595 .plug = 1,
596 .iopoll = 1,
597 .iopoll_queue = 1,
598 .is_128 = 1,
599 .async_size = sizeof(struct io_async_cmd),
600 .prep = io_uring_cmd_prep,
601 .issue = io_uring_cmd,
602 },
603 [IORING_OP_IPC_SEND] = {
604 .audit_skip = 1,
> 605 .async_size = sizeof(struct io_ipc_send),
> 606 .prep = io_ipc_send_prep,
> 607 .issue = io_ipc_send,
608 },
609 [IORING_OP_IPC_RECV] = {
610 .audit_skip = 1,
> 611 .async_size = sizeof(struct io_ipc_recv),
> 612 .prep = io_ipc_recv_prep,
> 613 .issue = io_ipc_recv, 614 },
615 };
616
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 4 lines · Daniel Hodges
Performance (virtme-ng VM, single-socket,
msg_sizesweep 64B-32KB):Point-to-point latency (64B-32KB messages):
io_uring unicast: 597-3,185 ns/msg (within 1.5-2.5x of pipe for small msgs)
Benchmark sources used to generate the numbers in the cover letter:
io_uring IPC modes (broadcast, multicast, unicast):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-io_uring_ipc_bench-c
IPC comparison (pipes, unix sockets, shm+eventfd):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-ipc_comparison_bench-c
Jens Axboe
maintainerQuoted 6 lines · Daniel Hodges
Quoted 4 lines · Daniel Hodges
Performance (virtme-ng VM, single-socket,
msg_sizesweep 64B-32KB):Point-to-point latency (64B-32KB messages):
io_uring unicast: 597-3,185 ns/msg (within 1.5-2.5x of pipe for small msgs)
Quoted 7 lines
Benchmark sources used to generate the numbers in the cover letter:
io_uringIPC modes (broadcast, multicast, unicast):https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-io_uring_ipc_bench-cIPC comparison (pipes, unix sockets, shm+eventfd):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-ipc_comparison_bench-c
Thanks for sending these, was going to ask you about them. I'll take a look at your patches Monday.
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerQuoted 9 lines · Jens Axboe
Quoted 8 lines · Daniel Hodges
Quoted 4 lines · Daniel Hodges
Performance (virtme-ng VM, single-socket,
msg_sizesweep 64B-32KB):Point-to-point latency (64B-32KB messages):
io_uring unicast: 597-3,185 ns/msg (within 1.5-2.5x of pipe for small msgs)Benchmark sources used to generate the numbers in the cover letter:
Quoted 8 lines
Quoted 5 lines
io_uringIPC modes (broadcast, multicast, unicast):https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-io_uring_ipc_bench-cIPC comparison (pipes, unix sockets, shm+eventfd):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-ipc_comparison_bench-cThanks for sending these, was going to ask you about them. I'll take a look at your patches Monday.
Just a side note since I peeked at a bit - this is using the raw interface? But more importantly, you'd definitely want IORING_SETUP_DEFER_TASKRUN and IORING_SETUP_SINGLE_ISSUER set in those init flags.
Signature · 1 line
Jens Axboe
Quoted 9 lines · Jens Axboe
Quoted 8 lines · Daniel Hodges
Quoted 4 lines · Daniel Hodges
Performance (virtme-ng VM, single-socket,
msg_sizesweep 64B-32KB):Point-to-point latency (64B-32KB messages):
io_uring unicast: 597-3,185 ns/msg (within 1.5-2.5x of pipe for small msgs)Benchmark sources used to generate the numbers in the cover letter:
Quoted 11 lines
Quoted 5 lines
io_uringIPC modes (broadcast, multicast, unicast):https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-io_uring_ipc_bench-cIPC comparison (pipes, unix sockets, shm+eventfd):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-ipc_comparison_bench-cThanks for sending these, was going to ask you about them. I'll take a look at your patches Monday.
Signature · 1 line
Jens Axboe
No rush, thanks for taking the time!
-Daniel
Jens Axboe
maintainerQuoted 16 lines · Daniel Hodges
Quoted 15 lines · Jens Axboe
Quoted 13 lines · Daniel Hodges
Quoted 4 lines · Daniel Hodges
Performance (virtme-ng VM, single-socket,
msg_sizesweep 64B-32KB):Point-to-point latency (64B-32KB messages):
io_uring unicast: 597-3,185 ns/msg (within 1.5-2.5x of pipe for small msgs)Benchmark sources used to generate the numbers in the cover letter:
io_uringIPC modes (broadcast, multicast, unicast):https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-io_uring_ipc_bench-cIPC comparison (pipes, unix sockets, shm+eventfd):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-ipc_comparison_bench-c
Quoted 7 lines
Quoted 5 lines
Thanks for sending these, was going to ask you about them. I'll take a look at your patches Monday.
Signature · 1 line
Jens AxboeNo rush, thanks for taking the time!
I took a look - and I think it's quite apparent that it's a AI vibe coded patch. Hence my first question is, do you have a specific use case in mind? Or phrased differently, was this done for a specific use case you have and want to pursue, or was it more of a "let's see if we can do this and what it'd look like" kind of thing?
I have a lot of comments on the patch itself, but let's establish the motivation here first.
Signature · 1 line
Jens Axboe
Quoted 25 lines · Jens Axboe
Quoted 16 lines · Daniel Hodges
Quoted 15 lines · Jens Axboe
Quoted 13 lines · Daniel Hodges
Quoted 4 lines · Daniel Hodges
Performance (virtme-ng VM, single-socket,
msg_sizesweep 64B-32KB):Point-to-point latency (64B-32KB messages):
io_uring unicast: 597-3,185 ns/msg (within 1.5-2.5x of pipe for small msgs)Benchmark sources used to generate the numbers in the cover letter:
io_uringIPC modes (broadcast, multicast, unicast):https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-io_uring_ipc_bench-cIPC comparison (pipes, unix sockets, shm+eventfd):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-ipc_comparison_bench-cQuoted 7 lines
Quoted 5 lines
Thanks for sending these, was going to ask you about them. I'll take a look at your patches Monday.
Signature · 1 line
Jens AxboeNo rush, thanks for taking the time!
Quoted 11 lines
I took a look - and I think it's quite apparent that it's a AI vibe coded patch. Hence my first question is, do you have a specific use case in mind? Or phrased differently, was this done for a specific use case you have and want to pursue, or was it more of a "let's see if we can do this and what it'd look like" kind of thing?
I have a lot of comments on the patch itself, but let's establish the motivation here first.
Signature · 1 line
Jens Axboe
I've been helping Alexandre prototype a D-Bus broker replacement that scales better on large machines. Here's some docs/benchmarks:
https://github.com/fiorix/sbus/blob/main/sbus-broker/docs/analysis.md
The idea for this RFC by trying to come up with a design if D-Bus was to be built from the ground so that it could scale on large machines. D-Bus was built because the kernel never really had a broadcast/multicast solution for IPC and kdbus demonstrated that moving dbus into the kernel wasn't viable either. So that's where I sort of landed on the idea of what if io_uring could be used for this type of IPC.
There isn't a working io_uring backed D-Bus implementation yet as it would require features that aren't in this patch such a handling credentials etc. I fully acknowledge I had AI help in working on this, but if this idea make sense I would appreciate some human direction. If it seems like it could be feasible from your pespective I would like to try to give it a proper attempt. Thanks!
-Daniel
Quoted 49 lines · Daniel Hodges
Quoted 25 lines · Jens Axboe
Quoted 16 lines · Daniel Hodges
Quoted 15 lines · Jens Axboe
Quoted 13 lines · Daniel Hodges
Quoted 4 lines · Daniel Hodges
Performance (virtme-ng VM, single-socket,
msg_sizesweep 64B-32KB):Point-to-point latency (64B-32KB messages):
io_uring unicast: 597-3,185 ns/msg (within 1.5-2.5x of pipe for small msgs)Benchmark sources used to generate the numbers in the cover letter:
io_uringIPC modes (broadcast, multicast, unicast):https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-io_uring_ipc_bench-cIPC comparison (pipes, unix sockets, shm+eventfd):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-ipc_comparison_bench-cQuoted 7 lines
Quoted 5 lines
Thanks for sending these, was going to ask you about them. I'll take a look at your patches Monday.
Signature · 1 line
Jens AxboeNo rush, thanks for taking the time!
Quoted 11 lines
I took a look - and I think it's quite apparent that it's a AI vibe coded patch. Hence my first question is, do you have a specific use case in mind? Or phrased differently, was this done for a specific use case you have and want to pursue, or was it more of a "let's see if we can do this and what it'd look like" kind of thing?
I have a lot of comments on the patch itself, but let's establish the motivation here first.
Signature · 1 line
Jens AxboeI've been helping Alexandre prototype a D-Bus broker replacement that scales better on large machines. Here's some docs/benchmarks:
https://github.com/fiorix/sbus/blob/main/sbus-broker/docs/analysis.mdThe idea for this RFC by trying to come up with a design if D-Bus was to be built from the ground so that it could scale on large machines. D-Bus was built because the kernel never really had a broadcast/multicast solution for IPC and kdbus demonstrated that moving dbus into the kernel wasn't viable either. So that's where I sort of landed on the idea of what if
io_uringcould be used for this type of IPC.
Quoted 8 lines
There isn't a working
io_uringbacked D-Bus implementation yet as it would require features that aren't in this patch such a handling credentials etc. I fully acknowledge I had AI help in working on this, but if this idea make sense I would appreciate some human direction. If it seems like it could be feasible from your pespective I would like to try to give it a proper attempt. Thanks!-Daniel
I just realized the link I sent is private, here's a link to the D-Bus broker docs/benchmarks from my fork:
https://github.com/hodgesds/dbus-rust/blob/main/sbus-broker/docs/analysis.md
Jens Axboe
maintainerQuoted 49 lines · Daniel Hodges
Quoted 25 lines · Jens Axboe
Quoted 16 lines · Daniel Hodges
Quoted 15 lines · Jens Axboe
Quoted 13 lines · Daniel Hodges
Quoted 4 lines · Daniel Hodges
Performance (virtme-ng VM, single-socket,
msg_sizesweep 64B-32KB):Point-to-point latency (64B-32KB messages):
io_uring unicast: 597-3,185 ns/msg (within 1.5-2.5x of pipe for small msgs)Benchmark sources used to generate the numbers in the cover letter:
io_uringIPC modes (broadcast, multicast, unicast):https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-io_uring_ipc_bench-cIPC comparison (pipes, unix sockets, shm+eventfd):
https://gist.github.com/hodgesds/fbcd8bb8497bc0ec2bf1f95244a984fe#file-ipc_comparison_bench-cQuoted 7 lines
Quoted 5 lines
Thanks for sending these, was going to ask you about them. I'll take a look at your patches Monday.
Signature · 1 line
Jens AxboeNo rush, thanks for taking the time!
Quoted 11 lines
I took a look - and I think it's quite apparent that it's a AI vibe coded patch. Hence my first question is, do you have a specific use case in mind? Or phrased differently, was this done for a specific use case you have and want to pursue, or was it more of a "let's see if we can do this and what it'd look like" kind of thing?
I have a lot of comments on the patch itself, but let's establish the motivation here first.
Signature · 1 line
Jens AxboeI've been helping Alexandre prototype a D-Bus broker replacement that scales better on large machines. Here's some docs/benchmarks:
https://github.com/fiorix/sbus/blob/main/sbus-broker/docs/analysis.mdThe idea for this RFC by trying to come up with a design if D-Bus was to be built from the ground so that it could scale on large machines. D-Bus was built because the kernel never really had a broadcast/multicast solution for IPC and kdbus demonstrated that moving dbus into the kernel wasn't viable either. So that's where I sort of landed on the idea of what if
io_uringcould be used for this type of IPC.
Quoted 6 lines
There isn't a working
io_uringbacked D-Bus implementation yet as it would require features that aren't in this patch such a handling credentials etc. I fully acknowledge I had AI help in working on this, but if this idea make sense I would appreciate some human direction. If it seems like it could be feasible from your pespective I would like to try to give it a proper attempt. Thanks!
OK, thanks for the explanation! I do think it makes sense to do, and starting with the basic mechanism first makes sense. I haven't read your link yet, but I suppose that had details on what else would be needed feature wise on top of the base?
Signature · 1 line
Jens Axboe