-
Notifications
You must be signed in to change notification settings - Fork 246
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
Conversation
@CodiumAI-Agent /review |
PR Reviewer Guide 🔍(Review updated until commit af048fb)Here are some key observations to aid the review process:
|
7b60ca4
to
6dfd02b
Compare
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.
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 |
Persistent review updated to latest commit af048fb |
1b357e6
to
0bb37d0
Compare
Converting to draft until usersim bug is fixed. |
88d6e89
to
98263a7
Compare
d4a4a2b
to
9ed7807
Compare
b584f3e
to
771aa20
Compare
Switching to draft until usersim is fixed microsoft/usersim#224 |
771aa20
to
5dcef09
Compare
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.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (5)
- libs/runtime/ebpf_epoch.c: Language not supported
- libs/runtime/ebpf_epoch.h: Language not supported
- libs/runtime/ebpf_work_queue.c: Language not supported
- libs/runtime/ebpf_work_queue.h: Language not supported
- libs/runtime/unit/platform_unit_test.cpp: Language not supported
Signed-off-by: Alan Jowett <[email protected]>
Signed-off-by: Alan Jowett <[email protected]>
Signed-off-by: Alan Jowett <[email protected]>
e160329
to
ad7ddc4
Compare
/** | ||
* @brief Lock to ensure a consistent view of the active CPUs. | ||
*/ | ||
static ebpf_lock_t _ebpf_epoch_active_cpu_list_lock; ///< Lock to protect the active CPU list. |
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.
Consider renaming as this protects the cpu entry table and not only the active cpu list.
@@ -379,6 +450,10 @@ ebpf_epoch_enter(_Out_ ebpf_epoch_state_t* epoch_state) | |||
epoch_state->epoch = cpu_entry->current_epoch; | |||
ebpf_list_insert_tail(&cpu_entry->epoch_state_list, &epoch_state->epoch_list_entry); | |||
|
|||
if (!cpu_entry->active) { | |||
_ebpf_epoch_activate_cpu(epoch_state->cpu_id); |
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.
Consider having a _ebpf_epoch_activate_cpu_in_dispatch
variation of the function as well, to make the code more readable.
// If the epoch was EBPF_EPOCH_UNKNOWN_EPOCH (i.e. the CPU was activating when this memory was queued), then | ||
// update the freed_epoch for all items in the free list now that we know the current epoch. This occurs when | ||
// the CPU is activated and continues until the first epoch is proposed. | ||
if (cpu_entry->current_epoch == EBPF_EPOCH_UNKNOWN_EPOCH) { |
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.
suggestion: assert this CPU active flag is set to TRUE.
Closing out this PR as it makes the already complex epoch code more complicated. |
Pull request was closed
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:
Testing
CI/CD + 24 hour run of api_test.exe (previously failing after 2 hours).
Documentation
Yes, in the files.
Installation
No.