Skip to main content

CpuRemote

Struct CpuRemote 

Source
pub struct CpuRemote { /* private fields */ }
Expand description

Stable cross-CPU publication endpoint for one scheduler owner.

This object owns the IRQ-safe target runqueue, atomic delivery state, and intrusive owner-control inboxes. Owner-only runtime accounting and switch tail state remain in CpuLocal.

Implementations§

Source§

impl CpuRemote

Source

pub fn lifecycle_state(&self) -> CpuLifecycleState

Returns the CPU’s placement and publication lifecycle.

Source

pub fn is_online(&self) -> bool

Returns whether owner initialization and online publication completed.

Source§

impl CpuRemote

Source

pub const fn owner(&self) -> CpuId

Returns the CPU that owns the corresponding runqueue.

Source

pub unsafe fn claim_local( &self, cpu: *mut CpuLocal, ) -> Result<CpuLocalOwnerBorrow<'_>, TaskError>

Claims exclusive access to the corresponding owner-only scheduler object.

§Safety

cpu must identify the pinned, live CpuLocal associated with this endpoint. After runtime publication, every access that can overlap this claim must use the same endpoint rather than retaining an ungated borrow.

Source

pub unsafe fn borrow_local_in_scheduler_frame( &self, cpu: NonNull<CpuLocal>, ) -> CpuLocalOwnerBorrow<'_>

Borrows the owner-only scheduler state under an existing scheduler baton.

§Safety

cpu must identify this endpoint’s pinned CpuLocal. The caller must own the CPU’s IRQ-off scheduler frame for the complete returned borrow, and no dynamically claimed owner borrow may overlap it.

Source

pub fn current_thread(&self) -> Option<ThreadId>

Returns rq->curr under the authoritative runqueue lock.

Source

pub fn idle_thread(&self) -> Option<ThreadId>

Returns the configured idle-thread snapshot.

Source

pub fn busy_runtime_ns(&self) -> u64

Returns cumulative time this CPU has executed non-idle scheduler threads.

Source§

impl CpuRemote

Source

pub fn needs_reschedule(&self) -> bool

Tests the sticky reschedule request without consuming it.

Trait Implementations§

Source§

impl Debug for CpuRemote

Source§

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

Formats the value using the given formatter. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.