Commit fca66cf3 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Add io_uring_submit_and_wait call

Summary: Add io_uring_submit_and_wait call

Reviewed By: yfeldblum

Differential Revision: D21653382

fbshipit-source-id: 945aa877a30b3c6431089a113ece5999d1217eb4
parent e8f3237c
......@@ -265,10 +265,14 @@ int IoUringBackend::submitBusyCheck(int num, WaitForEventsMode waitForEvents) {
int i = 0;
int res;
while (i < num) {
res = ::io_uring_submit(&ioRing_);
if (waitForEvents == WaitForEventsMode::WAIT) {
res = ::io_uring_submit_and_wait(&ioRing_, 1);
} else {
res = ::io_uring_submit(&ioRing_);
}
if (res == -EBUSY) {
// if we get EBUSY, try to consume some CQ entries
getActiveEvents(waitForEvents);
getActiveEvents(WaitForEventsMode::DONT_WAIT);
continue;
}
if (res < 0) {
......@@ -342,7 +346,7 @@ size_t IoUringBackend::submitList(
ret += i;
} else {
if (static_cast<size_t>(i) == options_.maxSubmit) {
int num = submitBusyCheck(i, waitForEvents);
int num = submitBusyCheck(i, WaitForEventsMode::DONT_WAIT);
CHECK_EQ(num, i);
ret += i;
i = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment