Skip to content

Commit

Permalink
eio_linux: don't record submit events when there's nothing to submit
Browse files Browse the repository at this point in the history
  • Loading branch information
talex5 committed May 20, 2024
1 parent 73f913c commit 0df7e71
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(logs (and (>= 0.7.0) :with-test))
(fmt (>= 0.8.9))
(cmdliner (and (>= 1.1.0) :with-test))
(uring (>= 0.7))))
(uring (>= 0.9))))
(package
(name eio_posix)
(allow_empty) ; Work-around for dune bug #6938
Expand Down
2 changes: 1 addition & 1 deletion eio_linux.opam
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ depends: [
"logs" {>= "0.7.0" & with-test}
"fmt" {>= "0.8.9"}
"cmdliner" {>= "1.1.0" & with-test}
"uring" {>= "0.7"}
"uring" {>= "0.9"}
"odoc" {with-doc}
]
build: [
Expand Down
5 changes: 4 additions & 1 deletion lib_eio_linux/sched.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ let enter op fn =
Effect.perform (Enter fn)

let submit uring =
Trace.with_span "submit" (fun () -> Uring.submit uring)
if Uring.sqe_ready uring > 0 then
Trace.with_span "submit" (fun () -> Uring.submit uring)
else
0

let rec enqueue_job t fn =
match fn () with
Expand Down

0 comments on commit 0df7e71

Please sign in to comment.