pub trait PageResource<VM: VMBinding>: 'static {
Show 16 methods // Required methods fn alloc_pages( &self, space_descriptor: SpaceDescriptor, reserved_pages: usize, required_pages: usize, tls: VMThread ) -> Result<PRAllocResult, PRAllocFail>; fn get_available_physical_pages(&self) -> usize; fn common(&self) -> &CommonPageResource; fn common_mut(&mut self) -> &mut CommonPageResource; // Provided methods fn get_new_pages( &self, space_descriptor: SpaceDescriptor, reserved_pages: usize, required_pages: usize, tls: VMThread ) -> Result<PRAllocResult, PRAllocFail> { ... } fn reserve_pages(&self, pages: usize) -> usize { ... } fn clear_request(&self, reserved_pages: usize) { ... } fn update_zeroing_approach(&self, _nontemporal: bool, concurrent: bool) { ... } fn skip_concurrent_zeroing(&self) { ... } fn trigger_concurrent_zeroing(&self) { ... } fn concurrent_zeroing(&self) { ... } fn commit_pages( &self, reserved_pages: usize, actual_pages: usize, tls: VMThread ) { ... } fn reserved_pages(&self) -> usize { ... } fn committed_pages(&self) -> usize { ... } fn vm_map(&self) -> &'static dyn VMMap { ... } fn update_discontiguous_start(&mut self, _start: Address) { ... }
}

Required Methods§

source

fn alloc_pages( &self, space_descriptor: SpaceDescriptor, reserved_pages: usize, required_pages: usize, tls: VMThread ) -> Result<PRAllocResult, PRAllocFail>

source

fn get_available_physical_pages(&self) -> usize

Return the number of available physical pages by this resource. This includes all pages currently unused by this resource. If the resource is using a discontiguous space, it also includes the currently unassigned discontiguous space.

Note: This just considers physical pages (i.e. virtual memory pages allocated for use by this resource). This calculation is orthogonal to and does not consider any restrictions on the number of pages this resource may actually use at any time (i.e. the number of committed and reserved pages).

Note: The calculation is made on the assumption that all space that could be assigned to this resource would be assigned to this resource (i.e. the unused discontiguous space could just as likely be assigned to another competing resource).

source

fn common(&self) -> &CommonPageResource

source

fn common_mut(&mut self) -> &mut CommonPageResource

Provided Methods§

source

fn get_new_pages( &self, space_descriptor: SpaceDescriptor, reserved_pages: usize, required_pages: usize, tls: VMThread ) -> Result<PRAllocResult, PRAllocFail>

Allocate pages from this resource. Simply bump the cursor, and fail if we hit the sentinel. Return The start of the first page if successful, zero on failure.

source

fn reserve_pages(&self, pages: usize) -> usize

source

fn clear_request(&self, reserved_pages: usize)

source

fn update_zeroing_approach(&self, _nontemporal: bool, concurrent: bool)

source

fn skip_concurrent_zeroing(&self)

source

fn trigger_concurrent_zeroing(&self)

source

fn concurrent_zeroing(&self)

source

fn commit_pages( &self, reserved_pages: usize, actual_pages: usize, tls: VMThread )

Commit pages to the page budget. This is called after successfully determining that the request can be satisfied by both the page budget and virtual memory. This simply accounts for the discrepancy between committed and reserved while the request was pending.

This MUST be called by each PageResource during the allocPages, and the caller must hold the lock.

source

fn reserved_pages(&self) -> usize

source

fn committed_pages(&self) -> usize

source

fn vm_map(&self) -> &'static dyn VMMap

source

fn update_discontiguous_start(&mut self, _start: Address)

Implementors§