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

Reduce number of the reads from the interpreter symbol table #2290

Merged
merged 2 commits into from Nov 27, 2023

Conversation

kakkoyun
Copy link
Member

@kakkoyun kakkoyun commented Nov 23, 2023

Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com

  • Uses BPF_MAP_TYPE_LRU_HASH for the symbol table. To eliminate cleaning up the map.

Both BPF_MAP_TYPE_LRU_HASH and BPF_MAP_TYPE_LRU_PERCPU_HASH were introduced in version 4.10

  • Caches the symbol table in the user space.
  • Only updates the table if it encounters a new symbol ID.

It should work even better in combination with #2286

Benchmark

Before:

1500-2500 CGo calls pm

Metrics:
CleanShot 2023-11-23 at 21 25 50

Profile:

After:

200-300 CGo calls pm

Metrics:
CleanShot 2023-11-23 at 21 47 13

Profile:

Comparison
CleanShot 2023-11-23 at 21 44 22

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
@kakkoyun kakkoyun marked this pull request as ready for review November 23, 2023 20:49
@kakkoyun kakkoyun requested a review from a team as a code owner November 23, 2023 20:49
Copy link
Contributor

@javierhonduco javierhonduco left a comment

Choose a reason for hiding this comment

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

Thanks for catching the type mismatch between ID generation and the stored value and for reusing the code to insert / get frames.

Overall LGTM! As we discussed, I think the new logic to decide when to refresh the whole symbol table could be improved, e.g. only reading the missing symbols (if there aren't that many that are missing) and only redoing the whole symbol table entirely if it gets too large, for example

@kakkoyun kakkoyun merged commit fe60cdd into main Nov 27, 2023
22 checks passed
@kakkoyun kakkoyun deleted the interpreter_symbol_reads branch November 27, 2023 19:00
kakkoyun added a commit that referenced this pull request Nov 29, 2023
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

depends:  
- #2305 
- #2286
- #2290
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.

None yet

2 participants