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

linker: do not copy instructions when there is no reference in flattenInstructions #1647

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

paulcacheux
Copy link
Contributor

When resolving the bpf-to-bpf calls we need to copy the instructions from the program to flatten the references.

But when there is no reference there is nothing to do so we can skip the copy operation altogether.

@paulcacheux paulcacheux force-pushed the flatten-instructions-opt branch from 8056168 to 9ebb561 Compare January 20, 2025 09:50
@paulcacheux paulcacheux marked this pull request as ready for review January 20, 2025 11:06
@paulcacheux paulcacheux requested a review from a team as a code owner January 20, 2025 11:06
lmb
lmb previously requested changes Jan 21, 2025
Copy link
Collaborator

@lmb lmb left a comment

Choose a reason for hiding this comment

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

Could you add a test using testing.AllocsPerRun to make sure this doesn't regress?

@paulcacheux paulcacheux force-pushed the flatten-instructions-opt branch from 9ebb561 to 610f088 Compare January 21, 2025 15:51
@paulcacheux paulcacheux requested a review from lmb January 21, 2025 15:51
When resolving the bpf-to-bpf calls we need to copy the
instructions from the program to flatten the references.

But when there is no reference there is nothing to do so we
can skip the copy operation altogether.

Signed-off-by: Paul Cacheux <[email protected]>
@paulcacheux paulcacheux force-pushed the flatten-instructions-opt branch from 610f088 to 21eb181 Compare January 23, 2025 12:50
Copy link
Collaborator

@ti-mo ti-mo left a comment

Choose a reason for hiding this comment

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

Thanks!

@ti-mo ti-mo dismissed lmb’s stale review January 24, 2025 10:27

All good

@ti-mo ti-mo merged commit 87c3d7a into cilium:main Jan 24, 2025
17 checks passed
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.

3 participants