pub struct ZernelTaskState {
pub pid: u32,
pub is_ml_process: bool,
pub current_phase: WorkloadPhase,
pub gpu_utilization: u8,
pub last_gpu_sync_ns: u64,
pub cpu_burst_duration_ns: u64,
pub io_wait_fraction: f32,
pub nccl_active: bool,
pub futex_wait_count: u32,
pub gpu_id: Option<u32>,
pub phase_time_ns: PhaseTimeAccumulator,
pub phase_start_ns: u64,
}Expand description
Per-task state tracked by the Zernel scheduler.
Maintained in BPF maps at runtime; this Rust struct is the userspace mirror.
Fields§
§pid: u32§is_ml_process: bool§current_phase: WorkloadPhase§gpu_utilization: u8GPU utilization percentage (0-100).
last_gpu_sync_ns: u64Timestamp (ns) of last cudaDeviceSynchronize call.
cpu_burst_duration_ns: u64Duration (ns) of the most recent CPU burst.
io_wait_fraction: f32Fraction of time spent in I/O wait (0.0 - 1.0).
nccl_active: boolWhether NCCL shared memory is mapped for this process.
futex_wait_count: u32Recent futex wait count (high = collective coordination).
gpu_id: Option<u32>GPU ID this task is primarily using (for NUMA affinity).
phase_time_ns: PhaseTimeAccumulatorTotal time (ns) spent in each phase since tracking started.
phase_start_ns: u64Timestamp (ns) when current phase began.
Implementations§
Source§impl ZernelTaskState
impl ZernelTaskState
pub fn new(pid: u32) -> Self
Sourcepub fn transition_phase(&mut self, new_phase: WorkloadPhase, now_ns: u64)
pub fn transition_phase(&mut self, new_phase: WorkloadPhase, now_ns: u64)
Transition to a new phase, accumulating time in the old phase.
Trait Implementations§
Source§impl Clone for ZernelTaskState
impl Clone for ZernelTaskState
Source§fn clone(&self) -> ZernelTaskState
fn clone(&self) -> ZernelTaskState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ZernelTaskState
impl Debug for ZernelTaskState
Source§impl<'de> Deserialize<'de> for ZernelTaskState
impl<'de> Deserialize<'de> for ZernelTaskState
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ZernelTaskState
impl RefUnwindSafe for ZernelTaskState
impl Send for ZernelTaskState
impl Sync for ZernelTaskState
impl Unpin for ZernelTaskState
impl UnwindSafe for ZernelTaskState
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
Mutably borrows from an owned value. Read more