Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.h
| Show First 20 Lines • Show All 289 Lines • ▼ Show 20 Lines | |||||
| * object/vm_page_t because there is no knowledge of their pte | * object/vm_page_t because there is no knowledge of their pte | ||||
| * mappings, and such pages are also not on any PQ queue. | * mappings, and such pages are also not on any PQ queue. | ||||
| * | * | ||||
| */ | */ | ||||
| #define VPO_KMEM_EXEC 0x01 /* kmem mapping allows execution */ | #define VPO_KMEM_EXEC 0x01 /* kmem mapping allows execution */ | ||||
| #define VPO_SWAPSLEEP 0x02 /* waiting for swap to finish */ | #define VPO_SWAPSLEEP 0x02 /* waiting for swap to finish */ | ||||
| #define VPO_UNMANAGED 0x04 /* no PV management for page */ | #define VPO_UNMANAGED 0x04 /* no PV management for page */ | ||||
| #define VPO_SWAPINPROG 0x08 /* swap I/O in progress on page */ | #define VPO_SWAPINPROG 0x08 /* swap I/O in progress on page */ | ||||
| #ifdef BHYVE_SNAPSHOT | |||||
| #define VPO_VMM_DIRTY 0x80 /* dirty bit used for bhyve migration */ | |||||
| #endif | |||||
| /* | /* | ||||
| * Busy page implementation details. | * Busy page implementation details. | ||||
| * The algorithm is taken mostly by rwlock(9) and sx(9) locks implementation, | * The algorithm is taken mostly by rwlock(9) and sx(9) locks implementation, | ||||
| * even if the support for owner identity is removed because of size | * even if the support for owner identity is removed because of size | ||||
| * constraints. Checks on lock recursion are then not possible, while the | * constraints. Checks on lock recursion are then not possible, while the | ||||
| * lock assertions effectiveness is someway reduced. | * lock assertions effectiveness is someway reduced. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 397 Lines • ▼ Show 20 Lines | |||||
| void vm_page_xunbusy_hard(vm_page_t m); | void vm_page_xunbusy_hard(vm_page_t m); | ||||
| void vm_page_xunbusy_hard_unchecked(vm_page_t m); | void vm_page_xunbusy_hard_unchecked(vm_page_t m); | ||||
| void vm_page_set_validclean (vm_page_t, int, int); | void vm_page_set_validclean (vm_page_t, int, int); | ||||
| void vm_page_clear_dirty(vm_page_t, int, int); | void vm_page_clear_dirty(vm_page_t, int, int); | ||||
| void vm_page_set_invalid(vm_page_t, int, int); | void vm_page_set_invalid(vm_page_t, int, int); | ||||
| void vm_page_valid(vm_page_t m); | void vm_page_valid(vm_page_t m); | ||||
| int vm_page_is_valid(vm_page_t, int, int); | int vm_page_is_valid(vm_page_t, int, int); | ||||
| void vm_page_test_dirty(vm_page_t); | void vm_page_test_dirty(vm_page_t); | ||||
| #ifdef BHYVE_SNAPSHOT | |||||
| bool vm_page_test_vmm_dirty(vm_page_t m); | |||||
| #endif | |||||
| vm_page_bits_t vm_page_bits(int base, int size); | vm_page_bits_t vm_page_bits(int base, int size); | ||||
| void vm_page_zero_invalid(vm_page_t m, boolean_t setvalid); | void vm_page_zero_invalid(vm_page_t m, boolean_t setvalid); | ||||
| void vm_page_free_pages_toq(struct spglist *free, bool update_wire_count); | void vm_page_free_pages_toq(struct spglist *free, bool update_wire_count); | ||||
| void vm_page_dirty_KBI(vm_page_t m); | void vm_page_dirty_KBI(vm_page_t m); | ||||
| void vm_page_lock_KBI(vm_page_t m, const char *file, int line); | void vm_page_lock_KBI(vm_page_t m, const char *file, int line); | ||||
| void vm_page_unlock_KBI(vm_page_t m, const char *file, int line); | void vm_page_unlock_KBI(vm_page_t m, const char *file, int line); | ||||
| int vm_page_trylock_KBI(vm_page_t m, const char *file, int line); | int vm_page_trylock_KBI(vm_page_t m, const char *file, int line); | ||||
| ▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | |||||
| vm_page_dirty(vm_page_t m) | vm_page_dirty(vm_page_t m) | ||||
| { | { | ||||
| /* Use vm_page_dirty_KBI() under INVARIANTS to save memory. */ | /* Use vm_page_dirty_KBI() under INVARIANTS to save memory. */ | ||||
| #if (defined(KLD_MODULE) && !defined(KLD_TIED)) || defined(INVARIANTS) | #if (defined(KLD_MODULE) && !defined(KLD_TIED)) || defined(INVARIANTS) | ||||
| vm_page_dirty_KBI(m); | vm_page_dirty_KBI(m); | ||||
| #else | #else | ||||
| m->dirty = VM_PAGE_BITS_ALL; | m->dirty = VM_PAGE_BITS_ALL; | ||||
| #ifdef BHYVE_SNAPSHOT | |||||
| m->oflags |= VPO_VMM_DIRTY; | |||||
| #endif | |||||
| #endif | #endif | ||||
| } | } | ||||
| /* | /* | ||||
| * vm_page_undirty: | * vm_page_undirty: | ||||
| * | * | ||||
| * Set page to not be dirty. Note: does not clear pmap modify bits | * Set page to not be dirty. Note: does not clear pmap modify bits | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 127 Lines • Show Last 20 Lines | |||||