History

io_uring/zcrx: allow synchronous buffer return

Returning buffers via a ring is performant and convenient, but it becomes a problem when/if the user misconfigured the ring size and it becomes full. Add a synchronous way to return buffers back to the page pool via a new register opcode. It's supposed to be a reliable slow path for refilling.

Pavel Begunkov committed 1 year ago

Commit 705d2ac1 parent 8fd08d84 files · +90 −0Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+12−0
@@ -689,6 +689,9 @@ enum io_uring_register_op { · 688 unmodified lines
689689 /* query various aspects of io_uring, see linux/io_uring/query.h */
690690 IORING_REGISTER_QUERY = 35,
691691
692+ /* return zcrx buffers back into circulation */
693+ IORING_REGISTER_ZCRX_REFILL = 36,
694+
692695 /* this goes last */
693696 IORING_REGISTER_LAST,
694697
@@ -1070,6 +1073,15 @@ struct io_uring_zcrx_ifq_reg { · 375 unmodified lines
10701073 __u64 __resv[3];
10711074 };
10721075
1076+struct io_uring_zcrx_sync_refill {
1077+ __u32 zcrx_id;
1078+ /* the number of entries to return */
1079+ __u32 nr_entries;
1080+ /* pointer to an array of struct io_uring_zcrx_rqe */
1081+ __u64 rqes;
1082+ __u64 __resv[2];
1083+};
1084+
10731085 #ifdef __cplusplus
10741086 }
10751087 #endif