BodyContentionWindow

Struct BodyContentionWindow 

Source
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: u64

The nominal monitor tick period (ns) the deltas were sampled at (100 ms in production). Used only by legacy witnesses without real interval widths.

§saturated: bool

True 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: bool

True 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: u64

Complete 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: bool

True 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: u64

The 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: u64

The 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

Source§

fn clone(&self) -> BodyContentionWindow

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BodyContentionWindow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BodyContentionWindow

Source§

fn default() -> BodyContentionWindow

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for BodyContentionWindow

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for BodyContentionWindow

Source§

fn eq(&self, other: &BodyContentionWindow) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for BodyContentionWindow

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for BodyContentionWindow

Source§

impl StructuralPartialEq for BodyContentionWindow

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,