Skip to content

Commit

Permalink
Set epoch for threads that join during CPU activation
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan Jowett committed Dec 2, 2024
1 parent 3f2fa27 commit 771aa20
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libs/runtime/ebpf_epoch.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,13 @@ _ebpf_epoch_messenger_propose_release_epoch(
for (ebpf_list_entry_t* entry = cpu_entry->epoch_state_list.Flink; entry != &cpu_entry->epoch_state_list;
entry = entry->Flink) {
epoch_state = CONTAINING_RECORD(entry, ebpf_epoch_state_t, epoch_list_entry);
if (epoch_state->epoch == EBPF_EPOCH_UNKNOWN_EPOCH) {
ebpf_assert(cpu_entry->current_epoch != EBPF_EPOCH_UNKNOWN_EPOCH);
// Assume the thread is in the previous epoch. This is safe because the CPU was not active when the thread
// entered the epoch and the epoch doesn't advance while CPUs are activating.
epoch_state->epoch = cpu_entry->current_epoch - 1;
}

minimum_epoch = min(minimum_epoch, epoch_state->epoch);
}

Expand Down

0 comments on commit 771aa20

Please sign in to comment.