Closed easypickings closed 2 months ago
So if I understand it right: when I create a ring with
IOPOLL
, setupN
SQEs, and then callio_uring_submit_and_wait(&ring, N)
, is it possible that the call returns with less thanN
CQEs available?
Looking at the kernel source, yes. It can return with less CQEs and you need to be able to catch that.
Just as @krisman said, yes it can return fewer entries than asked for, and the userspace should be able to handle it. It's also not IOPOLL specific behaviour, well may happen with normal rings.
By navigating the source codes, I find the function
io_uring_submit_and_wait
will call__io_uring_submit
, which ends up with the syscallio_uring_enter
:https://github.com/axboe/liburing/blob/f4e42a515cd78c8c9cac2be14222834be5f8df2b/src/queue.c#L368-L388
By the man page of
io_uring_enter
, it saysSo if I understand it right: when I create a ring with
IOPOLL
, setupN
SQEs, and then callio_uring_submit_and_wait(&ring, N)
, is it possible that the call returns with less thanN
CQEs available?