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

tetragon: Limit max entries of cgroup_rate_map when it's not used #2555

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

olsajiri
Copy link
Contributor

It's not needed when the feature is disabled.

@olsajiri olsajiri added the release-note/minor This PR introduces a minor user-visible change label Jun 13, 2024
@olsajiri olsajiri force-pushed the pr/olsajiri/cgroup_rate_fix branch from bfdc038 to 7c5848d Compare June 13, 2024 21:22
@olsajiri olsajiri requested a review from mtardy June 13, 2024 22:21
@olsajiri olsajiri marked this pull request as ready for review June 13, 2024 22:21
@olsajiri olsajiri requested a review from a team as a code owner June 13, 2024 22:21
Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for that, I tested and we get 30MB back (3x10MB) on my VM when not using it! :)

@@ -15,6 +15,10 @@ import (
"github.com/cilium/tetragon/pkg/sensors/program"
)

const (
hasMapMaxEntries = 32768 // this value could be fine tuned
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe the name could be related to the cgroup map?

@@ -27,7 +27,7 @@ struct cgroup_rate_options {

struct {
__uint(type, BPF_MAP_TYPE_PERCPU_HASH);
__uint(max_entries, 32768);
__uint(max_entries, 1);
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe adding a little comment that this can be resized at sensor loading time

It's not needed when the feature is disabled.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
@olsajiri olsajiri force-pushed the pr/olsajiri/cgroup_rate_fix branch from 7c5848d to 741ffdb Compare June 14, 2024 09:28
@mtardy mtardy merged commit 2d999fd into main Jun 14, 2024
43 checks passed
@mtardy mtardy deleted the pr/olsajiri/cgroup_rate_fix branch June 14, 2024 17:01
@mtardy mtardy added needs-backport/1.0 This PR needs backporting to 1.0 needs-backport/1.1 This PR needs backporting to 1.1 and removed needs-backport/1.0 This PR needs backporting to 1.0 needs-backport/1.1 This PR needs backporting to 1.1 labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants