Skip to content

cgroup_id_map: change example for CGRP_STORAGE to not use GET_F_CREATE#570

Open
dqminh wants to merge 1 commit into
cloudflare:masterfrom
dqminh:cgroup_id
Open

cgroup_id_map: change example for CGRP_STORAGE to not use GET_F_CREATE#570
dqminh wants to merge 1 commit into
cloudflare:masterfrom
dqminh:cgroup_id

Conversation

@dqminh

@dqminh dqminh commented Aug 28, 2025

Copy link
Copy Markdown
Contributor

BPF_LOCAL_STORAGE_GET_F_CREATE will create a zero entry if it does not find our cgroup in the CGRP_STORAGE. THis is unnecessary work as the entry should only be written by ebpf_exporter for cgroups that we are interested in, so we should not set the flag.

BPF_LOCAL_STORAGE_GET_F_CREATE will create a zero entry if it does not
find our cgroup in the CGRP_STORAGE. THis is unnecessary work as the entry
should only be written by ebpf_exporter for cgroups that we are
interested in, so we should not set the flag.

@netoptimizer netoptimizer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Further down you are using the value stored in *ok to select which map to update.
Thus, the BPF_LOCAL_STORAGE_GET_F_CREATE is correctly used here.

@netoptimizer

Copy link
Copy Markdown
Contributor

Have you seen: netoptimizer#1 (comment)

  • I found that this CGRP_STORAGE was slower than the hash type

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.

2 participants