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

Use batch operations #74

Closed
brancz opened this issue Oct 7, 2021 · 6 comments
Closed

Use batch operations #74

brancz opened this issue Oct 7, 2021 · 6 comments
Assignees
Labels
area/eBPF Something involving eBPF enhancement New feature or request

Comments

@brancz
Copy link
Member

brancz commented Oct 7, 2021

// TODO(brancz): Use libbpf batch functions.

libbpf supports the batch operations such as:

  • bpf_map_lookup_and_delete_batch
  • bpf_map_lookup_batch
  • bpf_map_delete_batch

These make sense to be used. Because we already load all the data from the BPF maps into the memory of our user-space program, so might as well do it efficiently. And not only does it allow us to batch, but it also allows us to delete items at the same time, which is exactly what we do anyways after each profiling iteration.

They first need to be implemented in libbpfgo.

@brancz brancz added enhancement New feature or request area/eBPF Something involving eBPF labels Oct 7, 2021
@derekparker
Copy link
Contributor

Sent in aquasecurity/libbpfgo#97 to support this.

@derekparker
Copy link
Contributor

Submitted aquasecurity/libbpfgo#101 to improve error checking within libbpfgo which is necessary for our usage of these batch operations.

derekparker added a commit to derekparker/parca-agent that referenced this issue Dec 21, 2021
This patch adds support for using eBPF batch operations on maps which
should dramatically improve the performance of the parca-agent by
enabling it to batch lookup and delete keys/values in maps in a single
operation.

This replaces the use of iterators in favor of iteration in batches.

Fixes parca-dev#74
@derekparker
Copy link
Contributor

This is currently blocked on a libbpfgo patch to improve error handling when calling into the libbpf C library.

See aquasecurity/libbpfgo#100 (comment) for a summary on my thoughts for error handling and look at comments from Grant on overall summary of where the patch is and the direction for it.

derekparker added a commit to derekparker/parca-agent that referenced this issue Jan 6, 2022
This patch adds support for using eBPF batch operations on maps which
should dramatically improve the performance of the parca-agent by
enabling it to batch lookup and delete keys/values in maps in a single
operation.

This replaces the use of iterators in favor of iteration in batches.

Fixes parca-dev#74
derekparker added a commit to derekparker/parca-agent that referenced this issue Jan 6, 2022
This patch adds support for using eBPF batch operations on maps which
should dramatically improve the performance of the parca-agent by
enabling it to batch lookup and delete keys/values in maps in a single
operation.

This replaces the use of iterators in favor of iteration in batches.

Fixes parca-dev#74
derekparker added a commit to derekparker/parca-agent that referenced this issue Jan 13, 2022
This patch adds support for using eBPF batch operations on maps which
should dramatically improve the performance of the parca-agent by
enabling it to batch lookup and delete keys/values in maps in a single
operation.

This replaces the use of iterators in favor of iteration in batches.

Fixes parca-dev#74
derekparker added a commit to derekparker/parca-agent that referenced this issue Jan 13, 2022
This patch adds support for using eBPF batch operations on maps which
should dramatically improve the performance of the parca-agent by
enabling it to batch lookup and delete keys/values in maps in a single
operation.

This replaces the use of iterators in favor of iteration in batches.

Fixes parca-dev#74
derekparker added a commit to derekparker/parca-agent that referenced this issue Jan 13, 2022
This patch adds support for using eBPF batch operations on maps which
should dramatically improve the performance of the parca-agent by
enabling it to batch lookup and delete keys/values in maps in a single
operation.

This replaces the use of iterators in favor of iteration in batches.

Fixes parca-dev#74
@kakkoyun kakkoyun self-assigned this Apr 5, 2022
@kakkoyun
Copy link
Member

kakkoyun commented Jul 4, 2022

#395 (reverted #403)
Waiting for the minimum supported kernel version to 5.2

@javierhonduco
Copy link
Contributor

👋 , is there any profile that shows this is a hotspot? If no, perhaps we can close it. We will always re-evaluate things and keep on profiling the agent to ensure that the performance is within what we expect

@kakkoyun
Copy link
Member

Let's close it 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/eBPF Something involving eBPF enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants