IORING_ENTER_GETEVENTS behavior #1026
Replies: 4 comments 2 replies
-
The syscall return value is always the number of requests submitted, not the number you waited for. The amount available in the CQ ring is readily available in userspace by just reading the ring. 5.10 is very old, newer kernels will have a setup flag that tells the submission side to always keep submitting even if an error occurred with one of the requests. Older kernels would stop submitting if an error occurred. Since there aren't a lot of details in your report, I'm guessing this is what is happening in your case. In short, the return value should be 512, unless something caused it to stop submitting. That would normally be an error case. |
Beta Was this translation helpful? Give feedback.
-
I will check with newer kernels. |
Beta Was this translation helpful? Give feedback.
-
The error will be in the completion events, in the
Yes, it's the number of events to wait for. More specifically, the number of CQEs that should be ready for reaping in the CQ ring upon return. |
Beta Was this translation helpful? Give feedback.
-
Got it. 512 IOs are prepared and are available when we enter main_loop
I see the following output - syscall return 512, pending = 0, available = 92 So there are no submit errors and all SQ was consumed properly. But the minimum_complete argument did not seem to be honored. |
Beta Was this translation helpful? Give feedback.
-
Hi,
My application prepares a bunch of IOs (about 512) and then submits them using
ret = __sys_io_uring_enter(ring_fd, 512, 128, IORING_ENTER_GETEVENTS , NULL);
The application then peeks and reaps the completed IOs. My question is about the value of ret above. Am I correct in assuming the value of ret will be at least 128 because IORING_ENTER_GETEVENTS flag has been specified?
Is there any condition (without failure) where ret can be less than 128? In my kernel (5.10) I can get 128 completions - but only after multiple io_uring_enter syscalls. The ring has been created without SQPOLL or IOPOLL.
Beta Was this translation helpful? Give feedback.
All reactions