struct Vmalloc {
initialized: bool,
subtree_ready: bool,
arena_initialized: bool,
bootstrap_frame: Option<PhysFrame>,
free_head: *mut VmallocNode,
alloc_head: *mut VmallocNode,
node_pool_free: *mut VmallocNode,
alloc_count: usize,
allocated_pages: usize,
metadata_pages: usize,
fail_count: usize,
last_failure: Option<VmallocFailureSnapshot>,
}Fields§
§initialized: bool§subtree_ready: bool§arena_initialized: boolTrue once the initial single-spanning free extent has been inserted.
Replaces the ambiguous !free_head.is_null() || !alloc_head.is_null()
guard that read as a free-space check rather than an init-state check.
bootstrap_frame: Option<PhysFrame>Bootstrap frame permanently mapped at VMALLOC_VIRT_START (arena page 0).
Keeping this mapping live anchors the intermediate page-table nodes
(PDPT → PD → PT) so they are present in the canonical kernel L4 table
and inherited by every address space created after init(). The frame
must never be freed while the kernel is running.
free_head: *mut VmallocNode§alloc_head: *mut VmallocNode§node_pool_free: *mut VmallocNode§alloc_count: usize§allocated_pages: usize§metadata_pages: usize§fail_count: usize§last_failure: Option<VmallocFailureSnapshot>Implementations§
Source§impl Vmalloc
impl Vmalloc
const fn new() -> Self
fn record_failure( &mut self, size: usize, pages: usize, error: VmallocError, ) -> VmallocError
unsafe fn refill_node_pool( &mut self, token: &IrqDisabledToken, ) -> Result<(), VmallocError>
unsafe fn alloc_node( &mut self, token: &IrqDisabledToken, ) -> Result<*mut VmallocNode, VmallocError>
unsafe fn release_node(&mut self, node: *mut VmallocNode)
unsafe fn ensure_arena_ready( &mut self, token: &IrqDisabledToken, ) -> Result<(), VmallocError>
unsafe fn reserve_range( &mut self, pages: usize, token: &IrqDisabledToken, ) -> Result<*mut VmallocNode, VmallocError>
unsafe fn insert_alloc_node(&mut self, node: *mut VmallocNode)
unsafe fn take_alloc_node_by_addr(&mut self, addr: u64) -> *mut VmallocNode
unsafe fn insert_free_node_merge(&mut self, node: *mut VmallocNode)
unsafe fn free_extent_count(&self) -> usize
unsafe fn largest_free_extent_pages(&self) -> usize
unsafe fn node_pool_free_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Sync for Vmalloc
impl Freeze for Vmalloc
impl RefUnwindSafe for Vmalloc
impl Unpin for Vmalloc
impl UnsafeUnpin for Vmalloc
impl UnwindSafe for Vmalloc
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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 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>
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