pub struct BodyContentionWindow {
pub tick_deltas: Vec<u64>,
pub tick_widths_ns: Vec<u64>,
pub tick_ns: u64,
pub saturated: bool,
pub complete: bool,
pub schedstat_cap_ns: u64,
pub schedstat_cap_complete: bool,
pub body_wall_ns: u64,
pub body_covered_ns: u64,
}Expand description
Body-phase peak-window contamination series. New witnesses store deltas of
the ktstr runner cgroup’s CPU PSI some total clock: time during which at
least one runnable task in that cgroup was stalled for CPU. This includes a
delayed vCPU even when its competitor is outside the cgroup, without
charging pressure in unrelated host cgroups. Each entry has its real
observation width in Self::tick_widths_ns, allowing the window
calculation to remain sound when the monitor is starved and wakes much
later than its nominal cadence.
Legacy/deserialized witnesses may have no width vector; those retain the
fixed-grid tick_ns interpretation. Bounded storage: observations are
nominally 100 ms apart and Body phases run minutes, so a few thousand
entries is typical; the series is capped at 36,000 intervals and
saturated is set if the cap is hit. When
saturated, the series is a PREFIX of the phase, so W computed from it
is a LOWER bound — a later verdict pass should treat that as reducing
confidence in a FailConfirmed rather than trusting a possibly-short W.
COVERAGE SOUNDNESS: new witnesses sample the cumulative PSI counter at
accepted lifecycle boundaries as well as monitor wakes, so the first and
last samples explicitly close the entire Body span. A starved monitor may
produce one coarse interval instead of many fine ones, but charging that
interval’s entire delta remains an upper bound for every window it can
touch. If either boundary sample fails or storage saturates, complete is
false and the seam cannot use the series to confirm a failure.
Legacy witnesses have no explicit completeness bit. For them the seam retains the old conservative check that the fixed-grid samples span enough of Body; an empty or clustered series can only demote a result, never produce a false confirmation.
Fields§
§tick_deltas: Vec<u64>Per-observation CPU-contention delta (ns) over the Body phase, in time
order. New witnesses use runner-cgroup CPU PSI some total; legacy
witnesses contain summed vCPU schedstat run-delay.
tick_widths_ns: Vec<u64>Real wall width (ns) of each corresponding delta interval. Empty on
legacy witnesses. When present, length matches tick_deltas and the
peak-window calculation uses these widths instead of a nominal grid.
tick_ns: u64The nominal monitor tick period (ns) the deltas were sampled at (100 ms in production). Used only by legacy witnesses without real interval widths.
saturated: boolTrue when Self::tick_deltas hit its cap and later Body ticks were
dropped — the series is then a prefix and W from it is a lower bound.
complete: boolTrue when lifecycle-event samples anchored BOTH ends of Body (the start is conservatively pulled back to the preceding lifecycle boundary to cover virtio dispatch lag), making the cumulative interval series complete even if it contains only one coarse interval. A host acceptance span shorter than ScenarioEnd’s guest duration invalidates those edge samples; the complete whole-vCPU-lifetime fallback may then restore completeness as one conservative interval. False on legacy sampled witnesses, whose coverage is inferred from their first/last monitor ticks.
schedstat_cap_ns: u64Complete summed vCPU schedstat run-delay (ns) over the conservative
wall span of this series, or (when the preceding lifecycle snapshot
raced vCPU startup) the enclosing whole-thread lifetime. When
Self::schedstat_cap_complete is true, W(L) is capped by this
value: a request cannot absorb more task-specific scheduling delay in
one window than all vCPUs accumulated over the enclosing span. This
removes unrelated runner-cgroup PSI without under-bounding the target
VM’s delay.
schedstat_cap_complete: boolTrue when the closing snapshot sampled the complete live vCPU set and the cap is therefore a sound upper bound. An exact matching opening snapshot produces the tighter Body delta; otherwise the complete whole-thread-life total is used. False for legacy witnesses and partial/failed closing reads, in which case the cap is ignored.
body_wall_ns: u64The wall span (ns) covered by the Body witness. Normally the start is
conservatively pinned to the accepted lifecycle boundary preceding
Body, covering any time the guest’s Body frame waited in virtio
dispatch; the end is the first accepted transition after Body. It may
therefore include adjacent-stage time, which makes W larger and can
only bias the verdict toward indeterminate. If that accepted span is
shorter than ScenarioEnd’s guest duration, the guest duration widens
it for the whole-lifetime fallback. 0 when Body was never observed.
body_covered_ns: u64The wall span (ns) the series actually covered. For event-anchored
complete witnesses this equals body_wall_ns; for legacy witnesses it
is the elapsed between the first and last Body monitor tick.
Trait Implementations§
Source§impl Clone for BodyContentionWindow
impl Clone for BodyContentionWindow
Source§fn clone(&self) -> BodyContentionWindow
fn clone(&self) -> BodyContentionWindow
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BodyContentionWindow
impl Debug for BodyContentionWindow
Source§impl Default for BodyContentionWindow
impl Default for BodyContentionWindow
Source§fn default() -> BodyContentionWindow
fn default() -> BodyContentionWindow
Source§impl<'de> Deserialize<'de> for BodyContentionWindow
impl<'de> Deserialize<'de> for BodyContentionWindow
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for BodyContentionWindow
impl PartialEq for BodyContentionWindow
Source§impl Serialize for BodyContentionWindow
impl Serialize for BodyContentionWindow
impl Eq for BodyContentionWindow
impl StructuralPartialEq for BodyContentionWindow
Auto Trait Implementations§
impl Freeze for BodyContentionWindow
impl RefUnwindSafe for BodyContentionWindow
impl Send for BodyContentionWindow
impl Sync for BodyContentionWindow
impl Unpin for BodyContentionWindow
impl UnwindSafe for BodyContentionWindow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more