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

pkg/sensors: fix memory use of unloaded sensors #3021

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

mtardy
Copy link
Member

@mtardy mtardy commented Oct 21, 2024

Fixes #3013

Sensors that are disabled are not loaded and should not use memory, thus we clear the LoadedMapsInfo on unloading programs.

@mtardy mtardy added the release-note/bug This PR fixes an issue in a previous release of Tetragon. label Oct 21, 2024
@mtardy mtardy requested a review from a team as a code owner October 21, 2024 09:35
@mtardy mtardy requested review from jrfastab and lambdanis October 21, 2024 09:35
@mtardy
Copy link
Member Author

mtardy commented Oct 21, 2024

Regarding the metrics talked here #2984 (comment), I think it still makes sense to report 0 for a disabled policy.

Sensors that are disabled are not loaded and should not use memory, thus
we clear the LoadedMapsInfo on unloading programs.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
@mtardy mtardy force-pushed the pr/mtardy/disable-kernel-memory branch from b350f2c to 8e2c979 Compare October 23, 2024 10:21
Copy link

netlify bot commented Oct 23, 2024

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 8e2c979
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/6718ce33fa29970008beb16a
😎 Deploy Preview https://deploy-preview-3021--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

This adds a high level tests making sure that the kernel memory bytes
stat is working and that disabling/enabling a policy should do what
expected with regard to kernel memory usage.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
@mtardy mtardy merged commit 5d390cb into main Oct 24, 2024
40 checks passed
@mtardy mtardy deleted the pr/mtardy/disable-kernel-memory branch October 24, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Disabled policies should update the tracing policy kernel memory consumption
2 participants