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

Add and remove CPU from epoch computation on active and idle #3920

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Alan-Jowett
Copy link
Member

@Alan-Jowett Alan-Jowett commented Oct 8, 2024

Description

Restore the changes reverted by 205802b and fix a bug that was causing use after free (the for loop for computing oldest epoch was malformed resulting in a no-op).

Note: This is intentionally three or more commits:

  1. Restore the reverted code (including the bug).
  2. Fix the bug.
  3. PR feedback and addition of new tests.

Testing

CI/CD + 24 hour run of api_test.exe (previously failing after 2 hours).

Documentation

Yes, in the files.

Installation

No.

@Alan-Jowett
Copy link
Member Author

@CodiumAI-Agent /review

@CodiumAI-Agent
Copy link

CodiumAI-Agent commented Oct 8, 2024

PR Reviewer Guide 🔍

(Review updated until commit af048fb)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Thread Safety
The code modifies shared state without sufficient synchronization mechanisms in several places, which could lead to race conditions or data corruption in a multi-threaded environment.

Resource Leak
The new implementation introduces potential resource leaks where allocated resources on error paths are not always properly freed or handled.

Error Handling
Error paths may not correctly restore previous states, potentially leaving the system in an inconsistent state after an error.

libs/runtime/ebpf_epoch.c Outdated Show resolved Hide resolved
libs/runtime/ebpf_epoch.c Outdated Show resolved Hide resolved
@Alan-Jowett Alan-Jowett force-pushed the cpu_activation branch 6 times, most recently from 7b60ca4 to 6dfd02b Compare October 9, 2024 18:24
Copy link
Collaborator

@hawkinsw hawkinsw left a comment

Choose a reason for hiding this comment

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

I hope that what I wrote isn't too annoying.

libs/runtime/unit/platform_unit_test.cpp Outdated Show resolved Hide resolved
@Alan-Jowett
Copy link
Member Author

I hope that what I wrote isn't too annoying.

No, I loved it. I dislike that en-gb and en-us differ like this :-P

@CodiumAI-Agent
Copy link

Persistent review updated to latest commit af048fb

libs/runtime/unit/platform_unit_test.cpp Outdated Show resolved Hide resolved
libs/runtime/ebpf_epoch.c Outdated Show resolved Hide resolved
@Alan-Jowett Alan-Jowett force-pushed the cpu_activation branch 2 times, most recently from 1b357e6 to 0bb37d0 Compare October 10, 2024 18:53
@Alan-Jowett Alan-Jowett marked this pull request as draft October 16, 2024 22:14
@Alan-Jowett
Copy link
Member Author

Converting to draft until usersim bug is fixed.

@Alan-Jowett Alan-Jowett marked this pull request as ready for review November 21, 2024 23:39
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.

4 participants