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

CPU Ref Cycles in unused #1405

Open
dave-tucker opened this issue May 3, 2024 · 2 comments · May be fixed by #1493
Open

CPU Ref Cycles in unused #1405

dave-tucker opened this issue May 3, 2024 · 2 comments · May be fixed by #1493
Labels
kind/feature New feature or request tech-debt

Comments

@dave-tucker
Copy link
Collaborator

dave-tucker commented May 3, 2024

What would you like to be added?

In working on #1398 I found that there are a number of unused eBPF maps.

See here: https://github.com/sustainable-computing-io/kepler/blob/main/bpfassets/bcc/bcc.c#L217

That the variable on_cpu_avg_freq is not used, therefore the function get_on_cpu_avg_freq and the map cpu_freq_array are also unused.

Following that through, the same is then true of on_cpu_ref_cycles_delta, which gets populated by get_on_cpu_ref_cycles and uses the maps cpu_ref_cycles and cpu_ref_cycles_hc_reader.

In addition, the global variables HZ and CPU_REF_FREQ are also unused.
N.B - SAMPLE_RATE wasn't being correctly populated before #1398 but it is now.

Before I remove all of this unused code it would be excellent to get some clarification on whether it is intended to be used or not.

cc @marceloamaral

Why is this needed?

In particular, the perf event array cpu_ref_cycles_hc_reader is populated by a hardware perf event and it's my understanding that these are a scarce resource. If we aren't intending to use it, then we should not open a perf event of this type/event.

@dave-tucker dave-tucker added the kind/feature New feature or request label May 3, 2024
@vimalk78
Copy link
Collaborator

if we remove collecting cpu freq in bpf side, we can also remove cpu freq related code in user space, and remove the metrics as well.

@dave-tucker
Copy link
Collaborator Author

Confirmed with @marceloamaral on the community meeting that this is unused and therefore can be removed from both the kernel and userspace side of kepler.

dave-tucker added a commit to dave-tucker/kepler that referenced this issue Jun 5, 2024
Removes a number of unused maps from the eBPF code.
Removes unused functions and config options from the
userland code.

Fixes: sustainable-computing-io#1405

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
@dave-tucker dave-tucker linked a pull request Jun 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request tech-debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants