Skip to main content

ZoneStats

Struct ZoneStats 

Source
pub struct ZoneStats {
Show 23 fields pub zone_type: ZoneType, pub base: u64, pub managed_pages: usize, pub present_pages: usize, pub spanned_pages: usize, pub reserved_pages: usize, pub allocated_pages: usize, pub cached_pages: usize, pub cached_unmovable_pages: usize, pub cached_movable_pages: usize, pub free_pages: usize, pub movable_free_pages: usize, pub unmovable_free_pages: usize, pub segment_count: usize, pub segment_capacity: usize, pub pageblock_count: usize, pub unmovable_pageblocks: usize, pub movable_pageblocks: usize, pub watermark_min: usize, pub watermark_low: usize, pub watermark_high: usize, pub lowmem_reserve_pages: usize, pub largest_free_order: Option<u8>,
}
Expand description

Snapshot statistics for a single memory zone.

The struct is plain data on purpose so low-level diagnostics and crash paths can snapshot it onto the stack without heap allocation.

Fields§

§zone_type: ZoneType

Zone classification.

§base: u64

Lowest physical address covered by the zone span.

§managed_pages: usize

Pages currently managed by buddy in this zone.

§present_pages: usize

Pages reported as usable by the firmware map before reservations.

§spanned_pages: usize

Outer span in pages, including holes.

§reserved_pages: usize

Pages removed from management during bootstrap.

§allocated_pages: usize

Pages allocated to live callers.

§cached_pages: usize

Order-0 pages currently parked in per-CPU caches.

§cached_unmovable_pages: usize

Cached pages parked in unmovable per-CPU caches.

§cached_movable_pages: usize

Cached pages parked in movable per-CPU caches.

§free_pages: usize

Effective free pages, including cached pages.

§movable_free_pages: usize

Free pages tracked in movable free lists.

§unmovable_free_pages: usize

Free pages tracked in unmovable free lists.

§segment_count: usize

Number of populated contiguous segments.

§segment_capacity: usize

Reserved segment-table capacity.

§pageblock_count: usize

Total number of pageblocks tracked across all segments.

§unmovable_pageblocks: usize

Pageblocks currently tagged unmovable.

§movable_pageblocks: usize

Pageblocks currently tagged movable.

§watermark_min: usize

Minimum watermark.

§watermark_low: usize

Low watermark.

§watermark_high: usize

High watermark.

§lowmem_reserve_pages: usize

Low-memory reserve kept for lower-priority paths.

§largest_free_order: Option<u8>

Largest currently available free order.

Implementations§

Source§

impl ZoneStats

Source

pub const fn empty() -> Self

Empty snapshot entry for stack-allocated arrays.

Source

pub fn hole_pages(&self) -> usize

Returns the number of hole pages inside the zone span.

Source

pub fn reserve_floor_pages(&self) -> usize

Returns the effective reserve floor enforced by policy.

Source

pub fn available_after_reserve_pages(&self) -> usize

Returns the free pages remaining after the reserve floor is discounted.

Source

pub fn pressure(&self) -> ZonePressure

Returns the derived pressure state from the current zone watermarks.

Trait Implementations§

Source§

impl Clone for ZoneStats

Source§

fn clone(&self) -> ZoneStats

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 ZoneStats

Source§

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

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

impl Copy for ZoneStats

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
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> 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
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.