class PageQueues

Defined at line 83 of file ../../zircon/kernel/vm/include/vm/page_queues.h

Allocated pages that are part of the cow pages in a VmObjectPaged can be placed in a page queue.

The page queues provide a way to

* Classify and group pages across VMO boundaries

* Retrieve the VMO that a page is contained in (via a back reference stored in the vm_page_t)

Once a page has been placed in a page queue its queue_node becomes owned by the page queue and

must not be used until the page has been Remove'd. It is not sufficient to call list_delete on

the queue_node yourself as this operation is not atomic and needs to be performed whilst holding

the PageQueues::lock_.

Public Members

static const size_t kNumReclaim

Public Methods

void PageQueues ()

Defined at line 14 of file ../../zircon/kernel/vm/page_queues.cc

void ~PageQueues ()

Defined at line 16 of file ../../zircon/kernel/vm/page_queues.cc

void RotateReclaimQueues ()

Performs a manually requested aging event. This ignores usual aging triggers / restrictions and

waits, if necessary, for aging to be possible and then performs it.

Only for tests and debugging.

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

Counts QueueCounts ()

Defined at line 20 of file ../../zircon/kernel/vm/page_queues.cc

bool DebugPageIsReclaim (const vm_page_t * page, size_t * queue)

This takes an optional output parameter that, if the function returns true, will contain the

index of the queue that the page was in.

Defined at line 26 of file ../../zircon/kernel/vm/page_queues.cc

bool DebugPageIsReclaimIsolate (const vm_page_t * page)

Defined at line 30 of file ../../zircon/kernel/vm/page_queues.cc

bool DebugPageIsPagerBackedDirty (const vm_page_t * page)

Defined at line 34 of file ../../zircon/kernel/vm/page_queues.cc

bool DebugPageIsAnonymous (const vm_page_t * page)

Defined at line 38 of file ../../zircon/kernel/vm/page_queues.cc

bool DebugPageIsAnyAnonymous (const vm_page_t * page)

Defined at line 42 of file ../../zircon/kernel/vm/page_queues.cc

bool DebugPageIsWired (const vm_page_t * page)

Defined at line 46 of file ../../zircon/kernel/vm/page_queues.cc

bool DebugPageIsHighPriority (const vm_page_t * page)

Defined at line 50 of file ../../zircon/kernel/vm/page_queues.cc

void PageQueues (const PageQueues & )

Defined at line 99 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void PageQueues (PageQueues && )

Defined at line 99 of file ../../zircon/kernel/vm/include/vm/page_queues.h

PageQueues & operator= (const PageQueues & )

Defined at line 99 of file ../../zircon/kernel/vm/include/vm/page_queues.h

PageQueues & operator= (PageQueues && )

Defined at line 99 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void SetWired (vm_page_t * page, VmCowPages * object, uint64_t page_offset)

TODO(https://fxbug.dev/537458631): Remove the annotations once cross-language inlining works.

Defined at line 108 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void SetAnonymous (vm_page_t * page, VmCowPages * object, uint64_t page_offset, bool skip_reclaim)

|skip_reclaim| controls whether reclaiming the page should be forcibly skipped regardless of

whether anonymous pages are considered reclaimable in general.

Defined at line 113 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void SetReclaim (vm_page_t * page, VmCowPages * object, uint64_t page_offset)

Defined at line 117 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void SetPagerBackedDirty (vm_page_t * page, VmCowPages * object, uint64_t page_offset)

Defined at line 120 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void SetHighPriority (vm_page_t * page, VmCowPages * object, uint64_t page_offset)

Defined at line 124 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void MoveToWired (vm_page_t * page)

All Move operations change the queue that a page is considered to be in, but do not change the

object or offset backlink information. The page must currently be in a valid page queue.

Defined at line 132 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void MoveToAnonymous (vm_page_t * page, bool skip_reclaim)

|skip_reclaim| controls whether reclaiming the page should be forcibly skipped regardless of

whether anonymous pages are considered reclaimable in general.

Defined at line 137 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void MoveToReclaim (vm_page_t * page)

Defined at line 140 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void MoveToReclaimDontNeed (vm_page_t * page)

Defined at line 143 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void MoveToPagerBackedDirty (vm_page_t * page)

Defined at line 146 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void MoveToHighPriority (vm_page_t * page)

Defined at line 149 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void MoveAnonymousToAnonymousZeroFork (vm_page_t * page)

If a page is presently in the anonymous (or reclaim queue, depending if anonymous pages are

reclaimable) moves it to the appropriate anonymous zero fork queue (exact queue depends on

whether zero forks are reclaimable or not). If the page is not in the anonymous queue then it

is not modified.

Defined at line 157 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void CompressFailed (vm_page_t * page)

Indicates that page has failed a compression attempted, and moves it to a separate queue to

prevent it from being considered part of the reclaim set, which makes it neither active nor

inactive. The specified page must be in the page queues, but if not presently in a reclaim

queue this method will do nothing.

TODO(https://fxbug.dev/42138396): Determine whether/how pages are moved back into the reclaim

pool and either further generalize this to support pager backed, or specialize FailedReclaim to

be explicitly only anonymous.

Defined at line 168 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void ChangeObjectOffsetArray (vm_page_t ** pages, VmCowPages * object, uint64_t * offsets, size_t count)

Changes the backlink information for a page and should only be called by the page owner under

its lock (that is the VMO lock). The page must currently be in a valid page queue.

Defined at line 174 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void Remove (vm_page_t * page)

Removes the page from any page list and returns ownership of the queue_node.

Defined at line 180 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void RemoveArrayIntoList (vm_page_t ** page, size_t count, VmPageDoublyLinkedList * out_list)

Batched version of Remove that also places all the pages in the specified list

Defined at line 182 of file ../../zircon/kernel/vm/include/vm/page_queues.h

void MarkAccessed (vm_page_t * page)

Tells the page queue this page has been accessed, and it should have its position in the queues

updated.

Defined at line 189 of file ../../zircon/kernel/vm/include/vm/page_queues.h

bool ReclaimIsOnlyPagerBacked ()

Returns whether or not the reclaim queues only include pager backed pages or not.

Defined at line 221 of file ../../zircon/kernel/vm/include/vm/page_queues.h

bool IsPageReclaimable (const vm_page_t * page)

Returns true if the page is in an isolate queue.

Defined at line 226 of file ../../zircon/kernel/vm/include/vm/page_queues.h

Records