class DiscardableVmoTracker

Defined at line 18 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

Tracks state relevant for discardable VMOs. This class offers separation of the logic required

for discardable VMO management; the members are still protected by the owning VmCowPages' lock.

Public Methods

void DiscardableVmoTracker ()

Defined at line 22 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

void ~DiscardableVmoTracker ()

Defined at line 23 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

void InitCowPages (VmCowPages * cow)

Defined at line 25 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

void RemoveFromDiscardableListLocked ()

Remove a discardable object from whichever global discardable list it is in. Called from the

VmCowPages destructor. Also resets the cow_ back reference.

Defined at line 118 of file ../../zircon/kernel/vm/discardable_vmo_tracker.cc

ktl::pair<zx_status_t, bool> LockDiscardableLocked (bool try_lock, bool * was_discarded_out)

Lock and unlock functions. Returns ZX_OK if the operation succeeded or an error code if it

failed, along with whether the VMO was moved between the discardable reclaimable and

non-reclaimable lists. The intent of this is to inform the caller if they might need to update

any book-keeping depending on whether the VMO becomes reclaimable or unreclaimable.

Defined at line 18 of file ../../zircon/kernel/vm/discardable_vmo_tracker.cc

ktl::pair<zx_status_t, bool> UnlockDiscardableLocked ()

Defined at line 41 of file ../../zircon/kernel/vm/discardable_vmo_tracker.cc

bool WasDiscardedLocked ()

Whether the VMO has been discarded and not locked again yet.

Defined at line 58 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

void SetDiscardedLocked ()

Mark the VMO as discarded.

Defined at line 63 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

DiscardableState discardable_state_locked ()

Accessors for private members.

Defined at line 75 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

uint64_t DebugGetLockCount ()

Debug functions exposed for testing.

Defined at line 80 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

void assert_cow_pages_locked ()

Helper to assert that the owning cow_'s lock is held on code paths where thread annotations

cannot express the locking requirements.

Defined at line 90 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h

bool IsEligibleForReclamationLocked ()

Returns whether this object qualifies for reclamation based on whether its state is

kReclaimable.

Defined at line 221 of file ../../zircon/kernel/vm/discardable_vmo_tracker.cc

DiscardablePageCounts DebugDiscardablePageCounts ()

static

Defined at line 235 of file ../../zircon/kernel/vm/discardable_vmo_tracker.cc

bool DebugIsReclaimable ()

Defined at line 197 of file ../../zircon/kernel/vm/discardable_vmo_tracker.cc

bool DebugIsUnreclaimable ()

Defined at line 205 of file ../../zircon/kernel/vm/discardable_vmo_tracker.cc

bool DebugIsDiscarded ()

Defined at line 213 of file ../../zircon/kernel/vm/discardable_vmo_tracker.cc

Enumerations

enum DiscardableState
Name Value
kUnset 0
kReclaimable 1
kUnreclaimable 2
kDiscarded 3

See comment near discardable_state_ for details.

Defined at line 33 of file ../../zircon/kernel/vm/include/vm/discardable_vmo_tracker.h