Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for uring probes #70

Merged
merged 3 commits into from
Aug 25, 2022
Merged

Add support for uring probes #70

merged 3 commits into from
Aug 25, 2022

Conversation

talex5
Copy link
Collaborator

@talex5 talex5 commented Aug 24, 2022

Closes #51. /cc @patricoferris

@talex5 talex5 marked this pull request as draft August 24, 2022 10:59
@talex5 talex5 marked this pull request as ready for review August 24, 2022 11:15
lib/uring/dune Outdated
Comment on lines 15 to 19
(deps
include/liburing.h
include/liburing/io_uring.h
include/liburing.h
include/liburing/io_uring.h
include/liburing/barrier.h
include/liburing/compat.h)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL 👍

"POLLHUP", Int;
let defs =
C.C_define.import c ~c_flags:["-D_GNU_SOURCE"; "-I"; Filename.concat (Sys.getcwd ()) "include"]
~includes:["fcntl.h"; "poll.h"; "sys/uio.h"; "linux/time_types.h"; "liburing.h"]
Copy link
Contributor

@bikallem bikallem Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linux/time_types.h can be removed from here if "liburing.h" can be successfully included by dune-configurator. liburing defines __kernel_timespec if not defined already - https://github.com/axboe/liburing/blob/master/configure#L446-L453.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I've removed it now.

in
let ops =
C.C_define.import c ~c_flags:["-D_GNU_SOURCE"; "-I"; Filename.concat (Sys.getcwd ()) "include"]
~includes:["fcntl.h"; "poll.h"; "sys/uio.h"; "linux/time_types.h"; "liburing.h"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above comment. linux/time_types.h is not needed if liburing.h can be included. Unless of course some other symbols defined in linux/time_types.h is needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed everything except liburing.h here.

@talex5 talex5 force-pushed the probe branch 3 times, most recently from e4e48fc to 1006646 Compare August 25, 2022 09:21
This also removes the need to import `linux/time_types.h` in
discover.ml, which was failing on some platforms.
@talex5 talex5 merged commit bf83ebc into ocaml-multicore:main Aug 25, 2022
@talex5 talex5 deleted the probe branch August 25, 2022 09:39
talex5 added a commit to talex5/opam-repository that referenced this pull request Aug 26, 2022
CHANGES:

New features:

- Add `Uring.timeout` (@bikallem ocaml-multicore/ocaml-uring#59).

- Add `Uring.read` and `Uring.write` (@haesbaert ocaml-multicore/ocaml-uring#62).
  These are simple wrappers for read(2) and write(2).

- Add `Uring.unlink` (@talex5 ocaml-multicore/ocaml-uring#65).
  This uses unlinkat(2), and so can also be used to remove directories.

- Add support for uring probes (@talex5 ocaml-multicore/ocaml-uring#70).
  Allows checking whether a feature is supported by the kernel at runtime.

- Rename `peek` to `get_cqe_nonblocking` (@talex5 ocaml-multicore/ocaml-uring#67).
  The old name was confusing because it does remove the item from the ring.

- Update to liburing 2.2 (@talex5 ocaml-multicore/ocaml-uring#56).

- Add `Uring.active_ops` (@talex5 ocaml-multicore/ocaml-uring#68).
  Avoids needing to track the value returned by `submit`, which is important as it is sometimes called automatically.

- Add `Uring.iov_max` constant (@talex5 ocaml-multicore/ocaml-uring#76).

- Add `Uring.get_debug_stats` (@talex5 ocaml-multicore/ocaml-uring#64).
  This should make it easier to check that the uring is behaving as expected.

Performance:

- Introduce a Sketch buffer per Uring (@haesbaert ocaml-multicore/ocaml-uring#63).
  The main motivation of this change is to avoid having one malloc per packet in readv(2), writev(2) and friends.

- Use `submit_and_wait` where appropriate (@haesbaert ocaml-multicore/ocaml-uring#69).

- Add a `readv` benchmark (@talex5 ocaml-multicore/ocaml-uring#64).

- Avoid unnecessary use of `CAMLparam` in the C stubs (@haesbaert ocaml-multicore/ocaml-uring#61).

Bug fixes:

- Prevent ring from being used after exit (@talex5 ocaml-multicore/ocaml-uring#78).

Build changes:

- Remove use of notty for formatting benchmark results (@talex5 ocaml-multicore/ocaml-uring#71).
  It prevented uring from being tested on OCaml 5.

- Use MDX for README (@talex5 ocaml-multicore/ocaml-uring#57).

- Convert tests to MDX (@talex5 ocaml-multicore/ocaml-uring#58 ocaml-multicore/ocaml-uring#73).

- Use opam-repository syntax for license (@kit-ty-kate ocaml-multicore/ocaml-uring#72).

- Remove internal `is_dirty` flag (@talex5 ocaml-multicore/ocaml-uring#77).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants