pub struct PageFaultCounter { /* private fields */ }Expand description
Stores monotonic counters of page refaults and total page faults in a shared VMO.
Both counters are measured in pages supplied by the userspace pager (including readahead), rather than the number of pager requests:
refault_count_ptr(offset 0): pages supplied that had already been supplied before and were subsequently evicted.fault_count_ptr(offset 8): total pages supplied by the userspace pager.
Implementations§
Source§impl PageFaultCounter
impl PageFaultCounter
Sourcepub fn from_vmo_readonly(vmo: Vmo) -> Result<Self, Status>
pub fn from_vmo_readonly(vmo: Vmo) -> Result<Self, Status>
Creates a new read-only PageFaultCounter from the provided VMO. The VMO must have the READ, MAP, and GET_PROPERTY rights.
Sourcepub fn increment_refaults(&self, count: u64, order: Ordering)
pub fn increment_refaults(&self, count: u64, order: Ordering)
Increments the page refault counter by count pages (pages resupplied after eviction).
Sourcepub fn read_refaults(&self, order: Ordering) -> u64
pub fn read_refaults(&self, order: Ordering) -> u64
Reads the page refault counter (in pages).
Sourcepub fn increment_faults(&self, count: u64, order: Ordering)
pub fn increment_faults(&self, count: u64, order: Ordering)
Increments the total page fault counter by count pages (total pages supplied by the
userspace pager, including readahead).
Sourcepub fn read_faults(&self, order: Ordering) -> u64
pub fn read_faults(&self, order: Ordering) -> u64
Reads the total page fault counter (in pages supplied).
Sourcepub fn readonly_vmo(&self) -> Result<Vmo, Status>
pub fn readonly_vmo(&self) -> Result<Vmo, Status>
Returns a read-only handle for the backing VMO.
Trait Implementations§
impl Send for PageFaultCounter
impl Sync for PageFaultCounter
Auto Trait Implementations§
impl Freeze for PageFaultCounter
impl RefUnwindSafe for PageFaultCounter
impl Unpin for PageFaultCounter
impl UnsafeUnpin for PageFaultCounter
impl UnwindSafe for PageFaultCounter
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