Skip to content

Comments

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

Merged
ti-mo merged 1 commit intocilium:mainfrom
paulcacheux:flatten-instructions-opt
Jan 24, 2025
Merged

linker: do not copy instructions when there is no reference in flattenInstructions#1647
ti-mo merged 1 commit intocilium:mainfrom
paulcacheux:flatten-instructions-opt

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
Contributor

@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
Contributor

@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