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

[backport v1.1] pkg/sensors: reduce memory footprint of unused fdinstall maps and various fixes #2693

Merged
merged 3 commits into from
Jul 19, 2024

Conversation

mtardy
Copy link
Member

@mtardy mtardy commented Jul 18, 2024

Reduce the kernel memory footprint (accounted by the cgroup memory controller) of the fdinstall feature when unused (around ~11MB per kprobe).

mtardy added 3 commits July 18, 2024 19:25
[ upstream commit 3a2947e ]

Signed-off-by: Mahe Tardy <[email protected]>
[ upstream commit 662885e ]

Previous condition was buggy and should have been:
hasStackTrace = hasStackTrace || KernelStackTrace || UserStackTrace
instead of :
hasStackTrace =  KernelStackTrace || UserStackTrace

Using a function simplify this.

Signed-off-by: Mahe Tardy <[email protected]>
[ upstream commit 2b31289 ]

Resize the fdinstall_map if needed to save memory, thus we are saving
~11MB of kernel memory by kprobe that are not using FollowFD, UnfollowFD
or CopyFD.

Signed-off-by: Mahe Tardy <[email protected]>
@mtardy mtardy added kind/backport This PR provides functionality previously merged into master. release-note/bug This PR fixes an issue in a previous release of Tetragon. labels Jul 18, 2024
@mtardy mtardy requested a review from a team as a code owner July 18, 2024 17:27
@mtardy mtardy requested review from jrfastab and removed request for a team July 18, 2024 17:27
@mtardy mtardy changed the title [v1.1 backport] pkg/sensors: reduce memory footprint of unused fdinstall maps and various fixes [backport v1.1] pkg/sensors: reduce memory footprint of unused fdinstall maps and various fixes Jul 18, 2024
@mtardy mtardy merged commit b5c68c8 into v1.1 Jul 19, 2024
44 checks passed
@mtardy mtardy deleted the pr/mtardy/backport-v1.1-fdinstall branch July 19, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/backport This PR provides functionality previously merged into master. release-note/bug This PR fixes an issue in a previous release of Tetragon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants