Skip to content

Commit 62c1925

Browse files
committed
eio_linux: don't call submit immediately before wait
It's quicker to do it in a single call.
1 parent b126756 commit 62c1925

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib_eio_linux/sched.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ let rec schedule ({run_q; sleep_q; mem_q; uring; _} as st) : [`Exit_scheduler] =
228228
Lf_queue.push run_q IO; (* Re-inject IO job in the run queue *)
229229
handle_complete st ~runnable result
230230
| None ->
231-
ignore (submit uring : int);
232231
let timeout =
233232
match next_due with
234233
| `Wait_until time ->
@@ -239,6 +238,7 @@ let rec schedule ({run_q; sleep_q; mem_q; uring; _} as st) : [`Exit_scheduler] =
239238
| `Nothing -> None
240239
in
241240
if not (Lf_queue.is_empty st.run_q) then (
241+
ignore (submit uring : int);
242242
Lf_queue.push run_q IO; (* Re-inject IO job in the run queue *)
243243
schedule st
244244
) else if timeout = None && Uring.active_ops uring = 0 then (
@@ -267,6 +267,7 @@ let rec schedule ({run_q; sleep_q; mem_q; uring; _} as st) : [`Exit_scheduler] =
267267
) else (
268268
(* Someone added a new job while we were setting [need_wakeup] to [true].
269269
They might or might not have seen that, so we can't be sure they'll send an event. *)
270+
ignore (submit uring : int);
270271
Atomic.set st.need_wakeup false;
271272
Lf_queue.push run_q IO; (* Re-inject IO job in the run queue *)
272273
schedule st

0 commit comments

Comments
 (0)