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 d26184d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ocaml/opam:debian-11-ocaml-5.1
FROM ocaml/opam:debian-11-ocaml-5.2
# Make sure we're using opam-2.1:
RUN sudo ln -sf /usr/bin/opam-2.1 /usr/bin/opam
# Ensure opam-repository is up-to-date:
RUN cd opam-repository && git pull -q origin 0ac3fc79fd11ee365dd46119d43e9763cf57da52 && opam update
RUN cd opam-repository && git pull -q origin 97de3378749cf8d2d70a5d710d310e5cc17c9dea && opam update
# Install utop for interactive use:
RUN opam install utop fmt
# Install Eio's dependencies (adding just the opam files first to help with caching):
Expand Down
4 changes: 2 additions & 2 deletions bench.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ocaml/opam:debian-11-ocaml-5.1
FROM ocaml/opam:debian-11-ocaml-5.2
# Make sure we're using opam-2.1:
RUN sudo ln -sf /usr/bin/opam-2.1 /usr/bin/opam
# Ensure opam-repository is up-to-date:
RUN cd opam-repository && git pull -q origin 0ac3fc79fd11ee365dd46119d43e9763cf57da52 && opam update
RUN cd opam-repository && git pull -q origin 97de3378749cf8d2d70a5d710d310e5cc17c9dea && opam update
# Install Eio's dependencies (adding just the opam files first to help with caching):
RUN mkdir eio
WORKDIR eio
Expand Down
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 d26184d

Please sign in to comment.