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

Introduce ring buffers #163

Merged
merged 2 commits into from
Feb 16, 2025
Merged

Introduce ring buffers #163

merged 2 commits into from
Feb 16, 2025

Conversation

javierhonduco
Copy link
Owner

@javierhonduco javierhonduco commented Feb 16, 2025

Introduce ring buffers

Ring buffers offer several advantages compared to perf buffers, and they
are the more modern solution for BPF -> userspace communication. They
were introduced in Linux 5.8 so to ensure compatibility with older
kernels this commit chooses ring buffers if they are available. This can
be overriden with --force-perf-buffer.

Two of the reasons why ring buffers are quite exciting are potentially
less overhead when polling, thanks to the adaptative mechanism to try to
balance overhead while minimising lost samples and sharing the memory
for all the CPUs rather than having to have static per-CPU memory
regions which can be less fair.

Future work

The size of the ring buffers hasn't been tuned properly yet.

Test Plan

Lots of manual tests + CI

vmtest: Specify architecture and use /tmp

By default, the env var TMDIR is queried, which might not be shared in
the test VMs.

By default, the env var TMDIR is queried, which might not be shared in
the test VMs.
Ring buffers offer several advantages compared to perf buffers, and they
are the more modern solution for BPF -> userspace communication. They
were introduced in Linux 5.8 so to ensure compatibility with older
kernels this commit chooses ring buffers if they are available. This can
be overriden with `--force-perf-buffer`.

Two of the reasons why ring buffers are quite exciting are potentially
less overhead when polling, thanks to the adaptative mechanism to try to
balance overhead while minimising lost samples and sharing the memory
for all the CPUs rather than having to have static per-CPU memory
regions which can be less fair.

Future work
===========

The size of the ring buffers hasn't been tuned properly yet.

Test Plan
=========

Lots of manual tests + CI
@javierhonduco javierhonduco merged commit 4b389c0 into main Feb 16, 2025
5 checks passed
@javierhonduco javierhonduco deleted the use-ring-buffers branch February 16, 2025 13:57
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.

1 participant