Notes on io_uring

io_uring (ring buffers) are opened as file descriptors, and are reference counted.

When in default submission mode (userspace thread calls io_uring_enter(2)), when every userspace thread dies (reference count drop to 0), the tasks remained not submitted in the ring buffer are lost.

When in kernel thread submission mode (SQ Polling in io_uring(7)), a kernel thread manages a ring buffer. Since the userspace thread need to supply an array of file descriptors, I think that the kernel thread adds 1 to the reference count of those files, and will drop the ring buffer once all tasks are completed.