struct vm_page
Defined at line 27 of file ../../zircon/kernel/vm/include/vm/page.h
core per page structure allocated at pmm arena creation time
Public Members
list_node queue_node
paddr_t paddr_priv
vm_page_state state_priv
uint8_t loaned_state_priv
static const uint8_t kLoanedStateIsLoaned
static const uint8_t kLoanedStateIsLoanCancelled
Public Methods
void dump ()
Defined at line 24 of file ../../zircon/kernel/vm/page.cc
uint64_t get_count (vm_page_state state)
Return the approximate number of pages in state |state|.
When called concurrently with |set_state|, the count may be off by a small amount.
Defined at line 35 of file ../../zircon/kernel/vm/page.cc
void add_to_initial_count (vm_page_state state, uint64_t n)
Add |n| to the count of pages in state |state|.
Should be used when first constructing pages.
Defined at line 46 of file ../../zircon/kernel/vm/page.cc
bool is_free ()
Returns whether this page is in the FREE state. When in the FREE state the page is assumed to
be owned by the relevant PmmNode, and hence unless its lock is held this query must be assumed
to be racy.
Defined at line 165 of file ../../zircon/kernel/vm/include/vm/page.h
bool is_free_loaned ()
Returns whether this page is in the FREE_LOANED state. Similar to the FREE state the page is
assumed to be owned by the relevant PmmNode, however this distinguishes whether the page is
part of the general purpose free list, versus the more narrowly usable set of loaned pages.
Defined at line 170 of file ../../zircon/kernel/vm/include/vm/page.h
bool is_loaned ()
If true, this page is "loaned" in the sense of being loaned from a contiguous VMO (via
decommit) to Zircon. If the original contiguous VMO is deleted, this page will no longer be
loaned. A loaned page cannot be pinned. Instead a different physical page (non-loaned) is
used for the pin. A loaned page can be (re-)committed back into its original contiguous VMO,
which causes the data in the loaned page to be moved into a different physical page (which
itself can be non-loaned or loaned). A loaned page cannot be used to allocate a new contiguous
VMO.
Maybe queried by anyone who either owns the page, or has sufficient knowledge that the loaned
state cannot be being altered in parallel.
Defined at line 181 of file ../../zircon/kernel/vm/include/vm/page.h
bool is_loan_cancelled ()
If true, the original contiguous VMO wants the page back. Such pages won't be re-used until
the page is no longer loaned, either via commit of the page back into the contiguous VMO that
loaned the page, or via deletion of the contiguous VMO that loaned the page. Such pages are
not in the free_loaned_list_ in pmm, which is how re-use is prevented.
Should only be called by the PmmNode under its lock.
Defined at line 192 of file ../../zircon/kernel/vm/include/vm/page.h
void set_is_loaned ()
Manipulation of 'loaned' should only be done by the PmmNode under the loaned pages lock whilst
it is the owner of the page.
Defined at line 199 of file ../../zircon/kernel/vm/include/vm/page.h
void clear_is_loaned ()
Defined at line 203 of file ../../zircon/kernel/vm/include/vm/page.h
void set_is_loan_cancelled ()
Manipulation of 'loan_cancelled' should only be done by the PmmNode under its lock, but may be
done when the PmmNode is not the owner of the page.
Defined at line 210 of file ../../zircon/kernel/vm/include/vm/page.h
void clear_is_loan_cancelled ()
Defined at line 214 of file ../../zircon/kernel/vm/include/vm/page.h
paddr_t paddr ()
return the physical address
future plan to store in a compressed form
Defined at line 223 of file ../../zircon/kernel/vm/include/vm/page.h
vm_page_state state ()
Defined at line 225 of file ../../zircon/kernel/vm/include/vm/page.h
void set_state (vm_page_state new_state)
Defined at line 231 of file ../../zircon/kernel/vm/include/vm/page.h