wip(probe): throwaway iterate-iterate-2AZ-vsync probe instrumentation
Uncommitted experimental probe code preserved for handoff. Per running memory these probes are inert/throwaway diagnostics, not production fixes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1196,6 +1196,26 @@ impl Scheduler {
|
||||
}
|
||||
}
|
||||
|
||||
/// Maximum guest timebase across every thread in every slot's runqueue
|
||||
/// (2.AZ). This is the global guest-clock proxy: it advances both when
|
||||
/// any thread executes (per-instruction `timebase += 1`) and when the
|
||||
/// idle path jumps the timebase forward to a pending deadline
|
||||
/// (`advance_all_timebases_to`). Unlike `ctx(hw_id).timebase` — which
|
||||
/// reads only the *currently scheduled* thread on one slot and therefore
|
||||
/// stalls whenever that slot's thread is Blocked — the max is monotone
|
||||
/// across the whole machine, so a v-sync ticker keyed to it keeps
|
||||
/// advancing even when the slot-0 thread is wedged. Deterministic:
|
||||
/// derived purely from guest-cycle state, never host wall-clock.
|
||||
/// Returns 0 when no threads exist.
|
||||
pub fn max_timebase(&self) -> u64 {
|
||||
self.slots
|
||||
.iter()
|
||||
.flat_map(|slot| slot.runqueue.iter())
|
||||
.map(|t| t.ctx.timebase)
|
||||
.max()
|
||||
.unwrap_or(0)
|
||||
}
|
||||
|
||||
/// Fast-forward the timebase to the earliest pending timed wait and
|
||||
/// wake that sleeper. Used when a round had no Ready threads and no
|
||||
/// timer fires closer than the earliest wait. Returns the woken
|
||||
|
||||
Reference in New Issue
Block a user