pub struct BuildReservation { /* private fields */ }Expand description
Two-phase build reservation handles (LLC flock plan + cgroup v2
sandbox + make -jN hint). Consumed by
kernel_build_pipeline; the factored-out
acquire_build_reservation builds it from cpu_cap without
depending on kernel source, enabling integration tests that
exercise the reservation logic against synthetic topologies.
Also acquired directly by cargo-ktstr’s harness-compile path
(bin/cargo_ktstr/run_cargo.rs) so a colocated runner’s
cargo build/nextest --no-run warm-up coordinates against the
SAME machine-global LLC flock namespace + cgroup cpuset as a
kernel build — hence pub (the bin holds this as an opaque RAII
guard, dropping it before the test-running phase). Fields stay
pub(crate): external holders only need the RAII lifetime and the
BuildReservation::make_jobs accessor, not field access.
Drop order is load-bearing: _sandbox is declared first and
drops first per Rust’s declaration-order field-drop rule;
this ensures the cgroup sandbox is removed before the LLC
flock is released. Otherwise a peer could observe the LLC
released before the cgroup is gone and mint a conflicting
plan.
Implementations§
Source§impl BuildReservation
impl BuildReservation
Sourcepub fn make_jobs(&self) -> Option<usize>
pub fn make_jobs(&self) -> Option<usize>
Reserved-CPU parallelism hint (plan.cpus.len()), or None
when no reservation was acquired (bypass / degraded sysfs).
The kernel-build path feeds it to make -jN; the cargo
harness-compile path feeds it to CARGO_BUILD_JOBS so parallel
rustc is capped to the reserved cpuset instead of exploding to
nproc inside a confined cgroup. None leaves the child build
on its own default.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BuildReservation
impl RefUnwindSafe for BuildReservation
impl Send for BuildReservation
impl Sync for BuildReservation
impl Unpin for BuildReservation
impl UnwindSafe for BuildReservation
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
§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