Trait mmtk::util::heap::pageresource::PageResource
source · 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§
fn alloc_pages( &self, space_descriptor: SpaceDescriptor, reserved_pages: usize, required_pages: usize, tls: VMThread ) -> Result<PRAllocResult, PRAllocFail>
sourcefn get_available_physical_pages(&self) -> usize
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).
fn common(&self) -> &CommonPageResource
fn common_mut(&mut self) -> &mut CommonPageResource
Provided Methods§
sourcefn get_new_pages(
&self,
space_descriptor: SpaceDescriptor,
reserved_pages: usize,
required_pages: usize,
tls: VMThread
) -> Result<PRAllocResult, PRAllocFail>
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.
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)
sourcefn commit_pages(
&self,
reserved_pages: usize,
actual_pages: usize,
tls: VMThread
)
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.