-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Cleanup cilium-calls map #732
Conversation
pkg/endpoint/endpoint.go
Outdated
return bpf.MapPath(CallsMapName + strconv.Itoa(id)) | ||
} | ||
|
||
// CallsMapPath returns the path to cilium tail calls map of an endpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported method Endpoint.CallsMapPathLocked should be of the form "CallsMapPathLocked ..."
@@ -674,6 +677,15 @@ func (e *Endpoint) PolicyMapPathLocked() string { | |||
return PolicyMapPath(int(e.ID)) | |||
} | |||
|
|||
func CallsMapPath(id int) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function CallsMapPath should have comment or be unexported
pkg/endpoint/endpoint.go
Outdated
@@ -158,6 +158,9 @@ const ( | |||
StateReady = string(models.EndpointStateReady) | |||
// StateRegenerating specifies when the endpoint is being regenerated. | |||
StateRegenerating = string(models.EndpointStateRegenerating) | |||
|
|||
// Base prefix for EP specific call map. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported const CallsMapName should be of the form "CallsMapName ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, only a couple of minor issues with comment formatting for godoc.
Ok, I fix these two comments up in the process. |
cilium_calls map is the only map in cilium that is currently marked as PIN_OBJECT_NS. Issue is that cilium daemon currently does not clean this up during EP removal. Over time, this consumes a bit of memory since the tail call map holds programs that hold maps itself, so f.e. even if we removed the CT maps from the BPF fs, they can still hold a ref in the kernel by one of the tail called programs and as such cannot be cleaned. Move them into PIN_GLOBAL_NS with the EP id appended in the name, and trigger removal once EP is deleted. Signed-off-by: Daniel Borkmann <daniel@cilium.io>
Signed-off-by: Daniel Borkmann <daniel@cilium.io>
b412616
to
73ed628
Compare
No description provided.