FreeBSD virtual memory subsystem code
vm_page.h File Reference
#include <vm/pmap.h>
#include <vm/_vm_phys.h>
#include <sys/kassert.h>
#include <machine/atomic.h>
Include dependency graph for vm_page.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  vm_page_astate
 
struct  vm_page
 

Macros

#define VPRC_BLOCKED   0x40000000u /* mappings are being removed */
 
#define VPRC_OBJREF   0x80000000u /* object reference, cleared with (O) */
 
#define VPRC_WIRE_COUNT(c)   ((c) & ~(VPRC_BLOCKED | VPRC_OBJREF))
 
#define VPRC_WIRE_COUNT_MAX   (~(VPRC_BLOCKED | VPRC_OBJREF))
 
#define VPO_KMEM_EXEC   0x01 /* kmem mapping allows execution */
 
#define VPO_SWAPSLEEP   0x02 /* waiting for swap to finish */
 
#define VPO_UNMANAGED   0x04 /* no PV management for page */
 
#define VPO_SWAPINPROG   0x08 /* swap I/O in progress on page */
 
#define VPB_BIT_SHARED   0x01
 
#define VPB_BIT_EXCLUSIVE   0x02
 
#define VPB_BIT_WAITERS   0x04
 
#define VPB_BIT_FLAGMASK    (VPB_BIT_SHARED | VPB_BIT_EXCLUSIVE | VPB_BIT_WAITERS)
 
#define VPB_SHARERS_SHIFT   3
 
#define VPB_SHARERS(x)    (((x) & ~VPB_BIT_FLAGMASK) >> VPB_SHARERS_SHIFT)
 
#define VPB_SHARERS_WORD(x)   ((x) << VPB_SHARERS_SHIFT | VPB_BIT_SHARED)
 
#define VPB_ONE_SHARER   (1 << VPB_SHARERS_SHIFT)
 
#define VPB_SINGLE_EXCLUSIVE   VPB_BIT_EXCLUSIVE
 
#define VPB_CURTHREAD_EXCLUSIVE   VPB_SINGLE_EXCLUSIVE
 
#define VPB_UNBUSIED   VPB_SHARERS_WORD(0)
 
#define VPB_FREED   (0xffffffff - VPB_BIT_SHARED)
 
#define PQ_NONE   255
 
#define PQ_INACTIVE   0
 
#define PQ_ACTIVE   1
 
#define PQ_LAUNDRY   2
 
#define PQ_UNSWAPPABLE   3
 
#define PQ_COUNT   4
 
#define VM_PAGE_HAVE_PGLIST
 
#define PDRSHIFT   21
 
#define pa_index(pa)   ((pa) >> PDRSHIFT)
 
#define PA_LOCKPTR(pa)   ((struct mtx *)(&pa_lock[pa_index(pa) % PA_LOCK_COUNT]))
 
#define PA_LOCKOBJPTR(pa)   ((struct lock_object *)PA_LOCKPTR((pa)))
 
#define PA_LOCK(pa)   mtx_lock(PA_LOCKPTR(pa))
 
#define PA_TRYLOCK(pa)   mtx_trylock(PA_LOCKPTR(pa))
 
#define PA_UNLOCK(pa)   mtx_unlock(PA_LOCKPTR(pa))
 
#define PA_UNLOCK_COND(pa)
 
#define PA_LOCK_ASSERT(pa, a)   mtx_assert(PA_LOCKPTR(pa), (a))
 
#define vm_page_lockptr(m)   (PA_LOCKPTR(VM_PAGE_TO_PHYS((m))))
 
#define vm_page_lock(m)   mtx_lock(vm_page_lockptr((m)))
 
#define vm_page_unlock(m)   mtx_unlock(vm_page_lockptr((m)))
 
#define vm_page_trylock(m)   mtx_trylock(vm_page_lockptr((m)))
 
#define vm_page_assert_locked(m)
 
#define vm_page_lock_assert(m, a)
 
#define PGA_WRITEABLE   0x0001 /* page may be mapped writeable */
 
#define PGA_REFERENCED   0x0002 /* page has been referenced */
 
#define PGA_EXECUTABLE   0x0004 /* page may be mapped executable */
 
#define PGA_ENQUEUED   0x0008 /* page is enqueued in a page queue */
 
#define PGA_DEQUEUE   0x0010 /* page is due to be dequeued */
 
#define PGA_REQUEUE   0x0020 /* page is due to be requeued */
 
#define PGA_REQUEUE_HEAD   0x0040 /* page requeue should bypass LRU */
 
#define PGA_NOSYNC   0x0080 /* do not collect for syncer */
 
#define PGA_SWAP_FREE   0x0100 /* page with swap space was dirtied */
 
#define PGA_SWAP_SPACE   0x0200 /* page has allocated swap space */
 
#define PGA_QUEUE_OP_MASK   (PGA_DEQUEUE | PGA_REQUEUE | PGA_REQUEUE_HEAD)
 
#define PGA_QUEUE_STATE_MASK   (PGA_ENQUEUED | PGA_QUEUE_OP_MASK)
 
#define PG_PCPU_CACHE   0x01 /* was allocated from per-CPU caches */
 
#define PG_FICTITIOUS   0x02 /* physical page doesn't exist */
 
#define PG_ZERO   0x04 /* page is zeroed */
 
#define PG_MARKER   0x08 /* special queue marker page */
 
#define PG_NODUMP   0x10 /* don't include this page in a dump */
 
#define ACT_DECLINE   1
 
#define ACT_ADVANCE   3
 
#define ACT_INIT   5
 
#define ACT_MAX   64
 
#define VM_PAGE_TO_PHYS(entry)   ((entry)->phys_addr)
 
#define VM_ALLOC_NORMAL   0
 
#define VM_ALLOC_INTERRUPT   1
 
#define VM_ALLOC_SYSTEM   2
 
#define VM_ALLOC_CLASS_MASK   3
 
#define VM_ALLOC_WAITOK   0x0008 /* (acn) Sleep and retry */
 
#define VM_ALLOC_WAITFAIL   0x0010 /* (acn) Sleep and return error */
 
#define VM_ALLOC_WIRED   0x0020 /* (acgnp) Allocate a wired page */
 
#define VM_ALLOC_ZERO   0x0040 /* (acgnp) Allocate a zeroed page */
 
#define VM_ALLOC_NORECLAIM   0x0080 /* (c) Do not reclaim after failure */
 
#define VM_ALLOC_AVAIL0   0x0100
 
#define VM_ALLOC_NOBUSY   0x0200 /* (acgp) Do not excl busy the page */
 
#define VM_ALLOC_NOCREAT   0x0400 /* (gp) Don't create a page */
 
#define VM_ALLOC_AVAIL1   0x0800
 
#define VM_ALLOC_IGN_SBUSY   0x1000 /* (gp) Ignore shared busy flag */
 
#define VM_ALLOC_NODUMP   0x2000 /* (ag) don't include in dump */
 
#define VM_ALLOC_SBUSY   0x4000 /* (acgp) Shared busy the page */
 
#define VM_ALLOC_NOWAIT   0x8000 /* (acgnp) Do not sleep */
 
#define VM_ALLOC_COUNT_MAX   0xffff
 
#define VM_ALLOC_COUNT_SHIFT   16
 
#define VM_ALLOC_COUNT_MASK   (VM_ALLOC_COUNT(VM_ALLOC_COUNT_MAX))
 
#define VM_ALLOC_COUNT(count)
 
#define PS_ALL_DIRTY   0x1
 
#define PS_ALL_VALID   0x2
 
#define PS_NONE_BUSY   0x4
 
#define VPR_TRYFREE   0x01
 
#define VPR_NOREUSE   0x02
 
#define vm_page_busy_fetch(m)   atomic_load_int(&(m)->busy_lock)
 
#define vm_page_assert_busied(m)
 
#define vm_page_assert_sbusied(m)
 
#define vm_page_assert_unbusied(m)
 
#define vm_page_assert_xbusied_unchecked(m)
 
#define vm_page_assert_xbusied(m)
 
#define vm_page_busied(m)    (vm_page_busy_fetch(m) != VPB_UNBUSIED)
 
#define vm_page_xbusied(m)    ((vm_page_busy_fetch(m) & VPB_SINGLE_EXCLUSIVE) != 0)
 
#define vm_page_busy_freed(m)    (vm_page_busy_fetch(m) == VPB_FREED)
 
#define vm_page_xunbusy(m)
 
#define vm_page_xunbusy_unchecked(m)
 
#define VM_PAGE_OBJECT_BUSY_ASSERT(m)   (void)0
 
#define VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits)   (void)0
 
#define vm_page_xbusy_claim(m)
 
#define VM_PAGE_AFLAG_SHIFT   16
 

Typedefs

typedef union vm_page_astate vm_page_astate_t
 

Functions

 TAILQ_HEAD (pglist, vm_page)
 
 SLIST_HEAD (spglist, vm_page)
 
vm_page_t PHYS_TO_VM_PAGE (vm_paddr_t pa)
 
bool vm_page_busy_acquire (vm_page_t m, int allocflags)
 
void vm_page_busy_downgrade (vm_page_t m)
 
int vm_page_busy_tryupgrade (vm_page_t m)
 
bool vm_page_busy_sleep (vm_page_t m, const char *msg, int allocflags)
 
void vm_page_busy_sleep_unlocked (vm_object_t obj, vm_page_t m, vm_pindex_t pindex, const char *wmesg, int allocflags)
 
void vm_page_free (vm_page_t m)
 
void vm_page_free_zero (vm_page_t m)
 
void vm_page_activate (vm_page_t)
 
void vm_page_advise (vm_page_t m, int advice)
 
vm_page_t vm_page_alloc (vm_object_t, vm_pindex_t, int)
 
vm_page_t vm_page_alloc_domain (vm_object_t, vm_pindex_t, int, int)
 
vm_page_t vm_page_alloc_after (vm_object_t, vm_pindex_t, int, vm_page_t)
 
vm_page_t vm_page_alloc_domain_after (vm_object_t, vm_pindex_t, int, int, vm_page_t)
 
vm_page_t vm_page_alloc_contig (vm_object_t object, vm_pindex_t pindex, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr)
 
vm_page_t vm_page_alloc_contig_domain (vm_object_t object, vm_pindex_t pindex, int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr)
 
vm_page_t vm_page_alloc_freelist (int, int)
 
vm_page_t vm_page_alloc_freelist_domain (int, int, int)
 
vm_page_t vm_page_alloc_noobj (int)
 
vm_page_t vm_page_alloc_noobj_domain (int, int)
 
vm_page_t vm_page_alloc_noobj_contig (int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr)
 
vm_page_t vm_page_alloc_noobj_contig_domain (int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr)
 
void vm_page_bits_set (vm_page_t m, vm_page_bits_t *bits, vm_page_bits_t set)
 
bool vm_page_blacklist_add (vm_paddr_t pa, bool verbose)
 
vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int)
 
vm_page_t vm_page_grab_unlocked (vm_object_t, vm_pindex_t, int)
 
int vm_page_grab_pages (vm_object_t object, vm_pindex_t pindex, int allocflags, vm_page_t *ma, int count)
 
int vm_page_grab_pages_unlocked (vm_object_t object, vm_pindex_t pindex, int allocflags, vm_page_t *ma, int count)
 
int vm_page_grab_valid (vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int allocflags)
 
int vm_page_grab_valid_unlocked (vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int allocflags)
 
void vm_page_deactivate (vm_page_t)
 
void vm_page_deactivate_noreuse (vm_page_t)
 
void vm_page_dequeue (vm_page_t m)
 
void vm_page_dequeue_deferred (vm_page_t m)
 
vm_page_t vm_page_find_least (vm_object_t, vm_pindex_t)
 
void vm_page_free_invalid (vm_page_t)
 
vm_page_t vm_page_getfake (vm_paddr_t paddr, vm_memattr_t memattr)
 
void vm_page_initfake (vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr)
 
void vm_page_init_marker (vm_page_t marker, int queue, uint16_t aflags)
 
void vm_page_init_page (vm_page_t m, vm_paddr_t pa, int segind)
 
int vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t)
 
void vm_page_invalid (vm_page_t m)
 
void vm_page_launder (vm_page_t m)
 
vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t)
 
vm_page_t vm_page_lookup_unlocked (vm_object_t, vm_pindex_t)
 
vm_page_t vm_page_next (vm_page_t m)
 
void vm_page_pqbatch_drain (void)
 
void vm_page_pqbatch_submit (vm_page_t m, uint8_t queue)
 
bool vm_page_pqstate_commit (vm_page_t m, vm_page_astate_t *old, vm_page_astate_t new)
 
vm_page_t vm_page_prev (vm_page_t m)
 
bool vm_page_ps_test (vm_page_t m, int flags, vm_page_t skip_m)
 
void vm_page_putfake (vm_page_t m)
 
void vm_page_readahead_finish (vm_page_t m)
 
bool vm_page_reclaim_contig (int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary)
 
bool vm_page_reclaim_contig_domain (int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary)
 
void vm_page_reference (vm_page_t m)
 
void vm_page_release (vm_page_t m, int flags)
 
void vm_page_release_locked (vm_page_t m, int flags)
 
vm_page_t vm_page_relookup (vm_object_t, vm_pindex_t)
 
bool vm_page_remove (vm_page_t)
 
bool vm_page_remove_xbusy (vm_page_t)
 
int vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t)
 
void vm_page_replace (vm_page_t mnew, vm_object_t object, vm_pindex_t pindex, vm_page_t mold)
 
int vm_page_sbusied (vm_page_t m)
 
vm_page_t vm_page_scan_contig (u_long npages, vm_page_t m_start, vm_page_t m_end, u_long alignment, vm_paddr_t boundary, int options)
 
vm_page_bits_t vm_page_set_dirty (vm_page_t m)
 
void vm_page_set_valid_range (vm_page_t m, int base, int size)
 
vm_offset_t vm_page_startup (vm_offset_t vaddr)
 
void vm_page_sunbusy (vm_page_t m)
 
bool vm_page_try_remove_all (vm_page_t m)
 
bool vm_page_try_remove_write (vm_page_t m)
 
int vm_page_trysbusy (vm_page_t m)
 
int vm_page_tryxbusy (vm_page_t m)
 
void vm_page_unhold_pages (vm_page_t *ma, int count)
 
void vm_page_unswappable (vm_page_t m)
 
void vm_page_unwire (vm_page_t m, uint8_t queue)
 
bool vm_page_unwire_noq (vm_page_t m)
 
void vm_page_updatefake (vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr)
 
void vm_page_wire (vm_page_t)
 
bool vm_page_wire_mapped (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_set_validclean (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_valid (vm_page_t m)
 
int vm_page_is_valid (vm_page_t, int, int)
 
void vm_page_test_dirty (vm_page_t)
 
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_free_pages_toq (struct spglist *free, bool update_wire_count)
 
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_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)
 
static vm_page_astate_t vm_page_astate_load (vm_page_t m)
 
static bool vm_page_astate_fcmpset (vm_page_t m, vm_page_astate_t *old, vm_page_astate_t new)
 
static void vm_page_aflag_clear (vm_page_t m, uint16_t bits)
 
static void vm_page_aflag_set (vm_page_t m, uint16_t bits)
 
static __inline void vm_page_dirty (vm_page_t m)
 
static __inline void vm_page_undirty (vm_page_t m)
 
static uint8_t _vm_page_queue (vm_page_astate_t as)
 
static uint8_t vm_page_queue (vm_page_t m)
 
static bool vm_page_active (vm_page_t m)
 
static bool vm_page_inactive (vm_page_t m)
 
static bool vm_page_in_laundry (vm_page_t m)
 
static u_int vm_page_drop (vm_page_t m, u_int val)
 
static bool vm_page_wired (vm_page_t m)
 
static bool vm_page_all_valid (vm_page_t m)
 
static bool vm_page_none_valid (vm_page_t m)
 
static int vm_page_domain (vm_page_t m)
 

Variables

vm_page_t bogus_page
 
struct mtx_padalign pa_lock []
 
vm_page_t vm_page_array
 
long vm_page_array_size
 
long first_page
 

Macro Definition Documentation

◆ ACT_ADVANCE

#define ACT_ADVANCE   3

Definition at line 469 of file vm_page.h.

◆ ACT_DECLINE

#define ACT_DECLINE   1

Definition at line 468 of file vm_page.h.

◆ ACT_INIT

#define ACT_INIT   5

Definition at line 470 of file vm_page.h.

◆ ACT_MAX

#define ACT_MAX   64

Definition at line 471 of file vm_page.h.

◆ pa_index

#define pa_index (   pa)    ((pa) >> PDRSHIFT)

Definition at line 356 of file vm_page.h.

◆ PA_LOCK

#define PA_LOCK (   pa)    mtx_lock(PA_LOCKPTR(pa))

Definition at line 359 of file vm_page.h.

◆ PA_LOCK_ASSERT

#define PA_LOCK_ASSERT (   pa,
 
)    mtx_assert(PA_LOCKPTR(pa), (a))

Definition at line 370 of file vm_page.h.

◆ PA_LOCKOBJPTR

#define PA_LOCKOBJPTR (   pa)    ((struct lock_object *)PA_LOCKPTR((pa)))

Definition at line 358 of file vm_page.h.

◆ PA_LOCKPTR

#define PA_LOCKPTR (   pa)    ((struct mtx *)(&pa_lock[pa_index(pa) % PA_LOCK_COUNT]))

Definition at line 357 of file vm_page.h.

◆ PA_TRYLOCK

#define PA_TRYLOCK (   pa)    mtx_trylock(PA_LOCKPTR(pa))

Definition at line 360 of file vm_page.h.

◆ PA_UNLOCK

#define PA_UNLOCK (   pa)    mtx_unlock(PA_LOCKPTR(pa))

Definition at line 361 of file vm_page.h.

◆ PA_UNLOCK_COND

#define PA_UNLOCK_COND (   pa)
Value:
do { \
if ((pa) != 0) { \
PA_UNLOCK((pa)); \
(pa) = 0; \
} \
} while (0)

Definition at line 362 of file vm_page.h.

◆ PDRSHIFT

#define PDRSHIFT   21

Definition at line 353 of file vm_page.h.

◆ PG_FICTITIOUS

#define PG_FICTITIOUS   0x02 /* physical page doesn't exist */

Definition at line 460 of file vm_page.h.

◆ PG_MARKER

#define PG_MARKER   0x08 /* special queue marker page */

Definition at line 462 of file vm_page.h.

◆ PG_NODUMP

#define PG_NODUMP   0x10 /* don't include this page in a dump */

Definition at line 463 of file vm_page.h.

◆ PG_PCPU_CACHE

#define PG_PCPU_CACHE   0x01 /* was allocated from per-CPU caches */

Definition at line 459 of file vm_page.h.

◆ PG_ZERO

#define PG_ZERO   0x04 /* page is zeroed */

Definition at line 461 of file vm_page.h.

◆ PGA_DEQUEUE

#define PGA_DEQUEUE   0x0010 /* page is due to be dequeued */

Definition at line 441 of file vm_page.h.

◆ PGA_ENQUEUED

#define PGA_ENQUEUED   0x0008 /* page is enqueued in a page queue */

Definition at line 440 of file vm_page.h.

◆ PGA_EXECUTABLE

#define PGA_EXECUTABLE   0x0004 /* page may be mapped executable */

Definition at line 439 of file vm_page.h.

◆ PGA_NOSYNC

#define PGA_NOSYNC   0x0080 /* do not collect for syncer */

Definition at line 444 of file vm_page.h.

◆ PGA_QUEUE_OP_MASK

#define PGA_QUEUE_OP_MASK   (PGA_DEQUEUE | PGA_REQUEUE | PGA_REQUEUE_HEAD)

Definition at line 448 of file vm_page.h.

◆ PGA_QUEUE_STATE_MASK

#define PGA_QUEUE_STATE_MASK   (PGA_ENQUEUED | PGA_QUEUE_OP_MASK)

Definition at line 449 of file vm_page.h.

◆ PGA_REFERENCED

#define PGA_REFERENCED   0x0002 /* page has been referenced */

Definition at line 438 of file vm_page.h.

◆ PGA_REQUEUE

#define PGA_REQUEUE   0x0020 /* page is due to be requeued */

Definition at line 442 of file vm_page.h.

◆ PGA_REQUEUE_HEAD

#define PGA_REQUEUE_HEAD   0x0040 /* page requeue should bypass LRU */

Definition at line 443 of file vm_page.h.

◆ PGA_SWAP_FREE

#define PGA_SWAP_FREE   0x0100 /* page with swap space was dirtied */

Definition at line 445 of file vm_page.h.

◆ PGA_SWAP_SPACE

#define PGA_SWAP_SPACE   0x0200 /* page has allocated swap space */

Definition at line 446 of file vm_page.h.

◆ PGA_WRITEABLE

#define PGA_WRITEABLE   0x0001 /* page may be mapped writeable */

Definition at line 437 of file vm_page.h.

◆ PQ_ACTIVE

#define PQ_ACTIVE   1

Definition at line 333 of file vm_page.h.

◆ PQ_COUNT

#define PQ_COUNT   4

Definition at line 336 of file vm_page.h.

◆ PQ_INACTIVE

#define PQ_INACTIVE   0

Definition at line 332 of file vm_page.h.

◆ PQ_LAUNDRY

#define PQ_LAUNDRY   2

Definition at line 334 of file vm_page.h.

◆ PQ_NONE

#define PQ_NONE   255

Definition at line 331 of file vm_page.h.

◆ PQ_UNSWAPPABLE

#define PQ_UNSWAPPABLE   3

Definition at line 335 of file vm_page.h.

◆ PS_ALL_DIRTY

#define PS_ALL_DIRTY   0x1

Definition at line 594 of file vm_page.h.

◆ PS_ALL_VALID

#define PS_ALL_VALID   0x2

Definition at line 595 of file vm_page.h.

◆ PS_NONE_BUSY

#define PS_NONE_BUSY   0x4

Definition at line 596 of file vm_page.h.

◆ VM_ALLOC_AVAIL0

#define VM_ALLOC_AVAIL0   0x0100

Definition at line 544 of file vm_page.h.

◆ VM_ALLOC_AVAIL1

#define VM_ALLOC_AVAIL1   0x0800

Definition at line 547 of file vm_page.h.

◆ VM_ALLOC_CLASS_MASK

#define VM_ALLOC_CLASS_MASK   3

Definition at line 538 of file vm_page.h.

◆ VM_ALLOC_COUNT

#define VM_ALLOC_COUNT (   count)
Value:
({ \
KASSERT((count) <= VM_ALLOC_COUNT_MAX, \
("%s: invalid VM_ALLOC_COUNT value", __func__)); \
(count) << VM_ALLOC_COUNT_SHIFT; \
})
#define VM_ALLOC_COUNT_SHIFT
Definition: vm_page.h:553
#define VM_ALLOC_COUNT_MAX
Definition: vm_page.h:552

Definition at line 555 of file vm_page.h.

◆ VM_ALLOC_COUNT_MASK

#define VM_ALLOC_COUNT_MASK   (VM_ALLOC_COUNT(VM_ALLOC_COUNT_MAX))

Definition at line 554 of file vm_page.h.

◆ VM_ALLOC_COUNT_MAX

#define VM_ALLOC_COUNT_MAX   0xffff

Definition at line 552 of file vm_page.h.

◆ VM_ALLOC_COUNT_SHIFT

#define VM_ALLOC_COUNT_SHIFT   16

Definition at line 553 of file vm_page.h.

◆ VM_ALLOC_IGN_SBUSY

#define VM_ALLOC_IGN_SBUSY   0x1000 /* (gp) Ignore shared busy flag */

Definition at line 548 of file vm_page.h.

◆ VM_ALLOC_INTERRUPT

#define VM_ALLOC_INTERRUPT   1

Definition at line 536 of file vm_page.h.

◆ VM_ALLOC_NOBUSY

#define VM_ALLOC_NOBUSY   0x0200 /* (acgp) Do not excl busy the page */

Definition at line 545 of file vm_page.h.

◆ VM_ALLOC_NOCREAT

#define VM_ALLOC_NOCREAT   0x0400 /* (gp) Don't create a page */

Definition at line 546 of file vm_page.h.

◆ VM_ALLOC_NODUMP

#define VM_ALLOC_NODUMP   0x2000 /* (ag) don't include in dump */

Definition at line 549 of file vm_page.h.

◆ VM_ALLOC_NORECLAIM

#define VM_ALLOC_NORECLAIM   0x0080 /* (c) Do not reclaim after failure */

Definition at line 543 of file vm_page.h.

◆ VM_ALLOC_NORMAL

#define VM_ALLOC_NORMAL   0

Definition at line 535 of file vm_page.h.

◆ VM_ALLOC_NOWAIT

#define VM_ALLOC_NOWAIT   0x8000 /* (acgnp) Do not sleep */

Definition at line 551 of file vm_page.h.

◆ VM_ALLOC_SBUSY

#define VM_ALLOC_SBUSY   0x4000 /* (acgp) Shared busy the page */

Definition at line 550 of file vm_page.h.

◆ VM_ALLOC_SYSTEM

#define VM_ALLOC_SYSTEM   2

Definition at line 537 of file vm_page.h.

◆ VM_ALLOC_WAITFAIL

#define VM_ALLOC_WAITFAIL   0x0010 /* (acn) Sleep and return error */

Definition at line 540 of file vm_page.h.

◆ VM_ALLOC_WAITOK

#define VM_ALLOC_WAITOK   0x0008 /* (acn) Sleep and retry */

Definition at line 539 of file vm_page.h.

◆ VM_ALLOC_WIRED

#define VM_ALLOC_WIRED   0x0020 /* (acgnp) Allocate a wired page */

Definition at line 541 of file vm_page.h.

◆ VM_ALLOC_ZERO

#define VM_ALLOC_ZERO   0x0040 /* (acgnp) Allocate a zeroed page */

Definition at line 542 of file vm_page.h.

◆ VM_PAGE_AFLAG_SHIFT

#define VM_PAGE_AFLAG_SHIFT   16

Definition at line 802 of file vm_page.h.

◆ vm_page_assert_busied

#define vm_page_assert_busied (   m)
Value:
KASSERT(vm_page_busied(m), \
("vm_page_assert_busied: page %p not busy @ %s:%d", \
(m), __FILE__, __LINE__))
#define vm_page_busied(m)
Definition: vm_page.h:754

Definition at line 723 of file vm_page.h.

◆ vm_page_assert_locked

#define vm_page_assert_locked (   m)

Definition at line 388 of file vm_page.h.

◆ VM_PAGE_ASSERT_PGA_WRITEABLE

#define VM_PAGE_ASSERT_PGA_WRITEABLE (   m,
  bits 
)    (void)0

Definition at line 797 of file vm_page.h.

◆ vm_page_assert_sbusied

#define vm_page_assert_sbusied (   m)
Value:
KASSERT(vm_page_sbusied(m), \
("vm_page_assert_sbusied: page %p not shared busy @ %s:%d", \
(m), __FILE__, __LINE__))
int vm_page_sbusied(vm_page_t m)
Definition: vm_page.c:958

Definition at line 728 of file vm_page.h.

◆ vm_page_assert_unbusied

#define vm_page_assert_unbusied (   m)
Value:
KASSERT((vm_page_busy_fetch(m) & ~VPB_BIT_WAITERS) != \
("vm_page_assert_xbusied: page %p busy_lock %#x owned" \
" by me @ %s:%d", \
(m), (m)->busy_lock, __FILE__, __LINE__)); \
#define vm_page_busy_fetch(m)
Definition: vm_page.h:721
#define VPB_BIT_WAITERS
Definition: vm_page.h:308
#define VPB_CURTHREAD_EXCLUSIVE
Definition: vm_page.h:323

Definition at line 733 of file vm_page.h.

◆ vm_page_assert_xbusied

#define vm_page_assert_xbusied (   m)
Value:
do { \
vm_page_assert_xbusied_unchecked(m); \
KASSERT((vm_page_busy_fetch(m) & ~VPB_BIT_WAITERS) == \
("vm_page_assert_xbusied: page %p busy_lock %#x not owned" \
" by me @ %s:%d", \
(m), (m)->busy_lock, __FILE__, __LINE__)); \
} while (0)

Definition at line 745 of file vm_page.h.

◆ vm_page_assert_xbusied_unchecked

#define vm_page_assert_xbusied_unchecked (   m)
Value:
do { \
KASSERT(vm_page_xbusied(m), \
("vm_page_assert_xbusied: page %p not exclusive busy @ %s:%d", \
(m), __FILE__, __LINE__)); \
} while (0)
#define vm_page_xbusied(m)
Definition: vm_page.h:757

Definition at line 740 of file vm_page.h.

◆ vm_page_busied

#define vm_page_busied (   m)     (vm_page_busy_fetch(m) != VPB_UNBUSIED)

Definition at line 754 of file vm_page.h.

◆ vm_page_busy_fetch

#define vm_page_busy_fetch (   m)    atomic_load_int(&(m)->busy_lock)

Definition at line 721 of file vm_page.h.

◆ vm_page_busy_freed

#define vm_page_busy_freed (   m)     (vm_page_busy_fetch(m) == VPB_FREED)

Definition at line 760 of file vm_page.h.

◆ VM_PAGE_HAVE_PGLIST

#define VM_PAGE_HAVE_PGLIST

Definition at line 340 of file vm_page.h.

◆ vm_page_lock

#define vm_page_lock (   m)    mtx_lock(vm_page_lockptr((m)))

Definition at line 378 of file vm_page.h.

◆ vm_page_lock_assert

#define vm_page_lock_assert (   m,
 
)

Definition at line 389 of file vm_page.h.

◆ vm_page_lockptr

#define vm_page_lockptr (   m)    (PA_LOCKPTR(VM_PAGE_TO_PHYS((m))))

Definition at line 377 of file vm_page.h.

◆ VM_PAGE_OBJECT_BUSY_ASSERT

#define VM_PAGE_OBJECT_BUSY_ASSERT (   m)    (void)0

Definition at line 796 of file vm_page.h.

◆ VM_PAGE_TO_PHYS

#define VM_PAGE_TO_PHYS (   entry)    ((entry)->phys_addr)

Definition at line 506 of file vm_page.h.

◆ vm_page_trylock

#define vm_page_trylock (   m)    mtx_trylock(vm_page_lockptr((m)))

Definition at line 380 of file vm_page.h.

◆ vm_page_unlock

#define vm_page_unlock (   m)    mtx_unlock(vm_page_lockptr((m)))

Definition at line 379 of file vm_page.h.

◆ vm_page_xbusied

#define vm_page_xbusied (   m)     ((vm_page_busy_fetch(m) & VPB_SINGLE_EXCLUSIVE) != 0)

Definition at line 757 of file vm_page.h.

◆ vm_page_xbusy_claim

#define vm_page_xbusy_claim (   m)

Definition at line 798 of file vm_page.h.

◆ vm_page_xunbusy

#define vm_page_xunbusy (   m)
Value:
do { \
if (!atomic_cmpset_rel_int(&(m)->busy_lock, \
vm_page_xunbusy_hard(m); \
} while (0)
#define VPB_UNBUSIED
Definition: vm_page.h:326

Definition at line 764 of file vm_page.h.

◆ vm_page_xunbusy_unchecked

#define vm_page_xunbusy_unchecked (   m)
Value:
do { \
if (!atomic_cmpset_rel_int(&(m)->busy_lock, \
vm_page_xunbusy_hard_unchecked(m); \
} while (0)

Definition at line 769 of file vm_page.h.

◆ VPB_BIT_EXCLUSIVE

#define VPB_BIT_EXCLUSIVE   0x02

Definition at line 307 of file vm_page.h.

◆ VPB_BIT_FLAGMASK

#define VPB_BIT_FLAGMASK    (VPB_BIT_SHARED | VPB_BIT_EXCLUSIVE | VPB_BIT_WAITERS)

Definition at line 309 of file vm_page.h.

◆ VPB_BIT_SHARED

#define VPB_BIT_SHARED   0x01

Definition at line 306 of file vm_page.h.

◆ VPB_BIT_WAITERS

#define VPB_BIT_WAITERS   0x04

Definition at line 308 of file vm_page.h.

◆ VPB_CURTHREAD_EXCLUSIVE

#define VPB_CURTHREAD_EXCLUSIVE   VPB_SINGLE_EXCLUSIVE

Definition at line 323 of file vm_page.h.

◆ VPB_FREED

#define VPB_FREED   (0xffffffff - VPB_BIT_SHARED)

Definition at line 329 of file vm_page.h.

◆ VPB_ONE_SHARER

#define VPB_ONE_SHARER   (1 << VPB_SHARERS_SHIFT)

Definition at line 316 of file vm_page.h.

◆ VPB_SHARERS

#define VPB_SHARERS (   x)     (((x) & ~VPB_BIT_FLAGMASK) >> VPB_SHARERS_SHIFT)

Definition at line 313 of file vm_page.h.

◆ VPB_SHARERS_SHIFT

#define VPB_SHARERS_SHIFT   3

Definition at line 312 of file vm_page.h.

◆ VPB_SHARERS_WORD

#define VPB_SHARERS_WORD (   x)    ((x) << VPB_SHARERS_SHIFT | VPB_BIT_SHARED)

Definition at line 315 of file vm_page.h.

◆ VPB_SINGLE_EXCLUSIVE

#define VPB_SINGLE_EXCLUSIVE   VPB_BIT_EXCLUSIVE

Definition at line 318 of file vm_page.h.

◆ VPB_UNBUSIED

#define VPB_UNBUSIED   VPB_SHARERS_WORD(0)

Definition at line 326 of file vm_page.h.

◆ VPO_KMEM_EXEC

#define VPO_KMEM_EXEC   0x01 /* kmem mapping allows execution */

Definition at line 294 of file vm_page.h.

◆ VPO_SWAPINPROG

#define VPO_SWAPINPROG   0x08 /* swap I/O in progress on page */

Definition at line 297 of file vm_page.h.

◆ VPO_SWAPSLEEP

#define VPO_SWAPSLEEP   0x02 /* waiting for swap to finish */

Definition at line 295 of file vm_page.h.

◆ VPO_UNMANAGED

#define VPO_UNMANAGED   0x04 /* no PV management for page */

Definition at line 296 of file vm_page.h.

◆ VPR_NOREUSE

#define VPR_NOREUSE   0x02

Definition at line 673 of file vm_page.h.

◆ VPR_TRYFREE

#define VPR_TRYFREE   0x01

Definition at line 672 of file vm_page.h.

◆ VPRC_BLOCKED

#define VPRC_BLOCKED   0x40000000u /* mappings are being removed */

Definition at line 275 of file vm_page.h.

◆ VPRC_OBJREF

#define VPRC_OBJREF   0x80000000u /* object reference, cleared with (O) */

Definition at line 276 of file vm_page.h.

◆ VPRC_WIRE_COUNT

#define VPRC_WIRE_COUNT (   c)    ((c) & ~(VPRC_BLOCKED | VPRC_OBJREF))

Definition at line 277 of file vm_page.h.

◆ VPRC_WIRE_COUNT_MAX

#define VPRC_WIRE_COUNT_MAX   (~(VPRC_BLOCKED | VPRC_OBJREF))

Definition at line 278 of file vm_page.h.

Typedef Documentation

◆ vm_page_astate_t

Function Documentation

◆ _vm_page_queue()

static uint8_t _vm_page_queue ( vm_page_astate_t  as)
inlinestatic

Definition at line 910 of file vm_page.h.

References vm_page_astate::flags, PGA_DEQUEUE, PQ_NONE, and vm_page_astate::queue.

Referenced by vm_page_queue(), vm_pageout_launder(), vm_pageout_scan_active(), and vm_pageout_scan_inactive().

Here is the caller graph for this function:

◆ PHYS_TO_VM_PAGE()

vm_page_t PHYS_TO_VM_PAGE ( vm_paddr_t  pa)

Definition at line 1221 of file vm_page.c.

References first_page, vm_page_array, vm_page_array_size, vm_phys_fictitious_to_vm_page(), and vm_phys_paddr_to_vm_page().

Referenced by kern_mincore(), kmem_bootstrap_free(), pcpu_page_free(), startup_free(), v2sizep(), v2sizev(), vm_phys_init(), vsetzoneslab(), and vtozoneslab().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SLIST_HEAD()

SLIST_HEAD ( spglist  ,
vm_page   
)

◆ TAILQ_HEAD()

TAILQ_HEAD ( pglist  ,
vm_page   
)

◆ vm_page_activate()

void vm_page_activate ( vm_page_t  m)

Definition at line 4159 of file vm_page.c.

References PGA_REQUEUE, PQ_ACTIVE, and vm_page_mvqueue().

Referenced by swp_pager_async_iodone(), vm_fault(), vm_fault_copy_entry(), vm_fault_populate(), vm_page_advise(), vm_page_readahead_finish(), and vm_pageout_flush().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_active()

static bool vm_page_active ( vm_page_t  m)
inlinestatic

Definition at line 931 of file vm_page.h.

References PQ_ACTIVE, and vm_page_queue().

Referenced by vm_swapout_object_deactivate_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_advise()

void vm_page_advise ( vm_page_t  m,
int  advice 
)

Definition at line 4370 of file vm_page.c.

References PGA_REFERENCED, pmap_is_modified(), VM_OBJECT_ASSERT_WLOCKED, vm_page_activate(), vm_page_aflag_clear(), vm_page_assert_xbusied, vm_page_deactivate_noreuse(), vm_page_dirty(), vm_page_in_laundry(), vm_page_launder(), and vm_page_undirty().

Referenced by vm_object_madvise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_aflag_clear()

static void vm_page_aflag_clear ( vm_page_t  m,
uint16_t  bits 
)
inlinestatic

◆ vm_page_aflag_set()

static void vm_page_aflag_set ( vm_page_t  m,
uint16_t  bits 
)
inlinestatic

◆ vm_page_all_valid()

◆ vm_page_alloc()

vm_page_t vm_page_alloc ( vm_object_t  object,
vm_pindex_t  pindex,
int  req 
)

Definition at line 1908 of file vm_page.c.

References vm_page::object, vm_page::pindex, vm_object::rtree, vm_page_alloc_after(), and vm_radix_lookup_le().

Referenced by swap_pager_getpages_locked(), swap_pager_swapoff_object(), vm_fault_allocate(), vm_fault_copy_entry(), vm_page_grab(), vm_page_grab_valid(), and vnode_pager_generic_getpages().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_alloc_after()

vm_page_t vm_page_alloc_after ( vm_object_t  object,
vm_pindex_t  pindex,
int  req,
vm_page_t  mpred 
)

Definition at line 1931 of file vm_page.c.

References vm_domainset_iter_page(), vm_domainset_iter_page_init(), and vm_page_alloc_domain_after().

Referenced by vm_page_alloc(), and vm_page_grab_pages().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_alloc_contig()

vm_page_t vm_page_alloc_contig ( vm_object_t  object,
vm_pindex_t  pindex,
int  req,
u_long  npages,
vm_paddr_t  low,
vm_paddr_t  high,
u_long  alignment,
vm_paddr_t  boundary,
vm_memattr_t  memattr 
)

Definition at line 2162 of file vm_page.c.

References vm_domainset_iter_page(), vm_domainset_iter_page_init(), and vm_page_alloc_contig_domain().

Here is the call graph for this function:

◆ vm_page_alloc_contig_domain()

vm_page_t vm_page_alloc_contig_domain ( vm_object_t  object,
vm_pindex_t  pindex,
int  domain,
int  req,
u_long  npages,
vm_paddr_t  low,
vm_paddr_t  high,
u_long  alignment,
vm_paddr_t  boundary,
vm_memattr_t  memattr 
)

◆ vm_page_alloc_domain()

vm_page_t vm_page_alloc_domain ( vm_object_t  object,
vm_pindex_t  pindex,
int  domain,
int  req 
)

Definition at line 1916 of file vm_page.c.

References vm_page::object, vm_page::pindex, vm_object::rtree, vm_page_alloc_domain_after(), and vm_radix_lookup_le().

Here is the call graph for this function:

◆ vm_page_alloc_domain_after()

◆ vm_page_alloc_freelist()

vm_page_t vm_page_alloc_freelist ( int  freelist,
int  req 
)

Definition at line 2402 of file vm_page.c.

References vm_domainset_iter_page(), vm_domainset_iter_page_init(), and vm_page_alloc_freelist_domain().

Here is the call graph for this function:

◆ vm_page_alloc_freelist_domain()

vm_page_t vm_page_alloc_freelist_domain ( int  domain,
int  freelist,
int  req 
)

Definition at line 2419 of file vm_page.c.

References _vm_page_alloc_noobj_domain().

Referenced by vm_page_alloc_freelist().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_alloc_noobj()

vm_page_t vm_page_alloc_noobj ( int  req)

Definition at line 2428 of file vm_page.c.

References vm_domainset_iter_page(), vm_domainset_iter_page_init(), and vm_page_alloc_noobj_domain().

Referenced by kmem_init_zero_region(), and pcpu_page_alloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_alloc_noobj_contig()

vm_page_t vm_page_alloc_noobj_contig ( int  req,
u_long  npages,
vm_paddr_t  low,
vm_paddr_t  high,
u_long  alignment,
vm_paddr_t  boundary,
vm_memattr_t  memattr 
)

Definition at line 2451 of file vm_page.c.

References vm_domainset_iter_page(), vm_domainset_iter_page_init(), and vm_page_alloc_noobj_contig_domain().

Referenced by vm_page_reclaim_run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_alloc_noobj_contig_domain()

vm_page_t vm_page_alloc_noobj_contig_domain ( int  domain,
int  req,
u_long  npages,
vm_paddr_t  low,
vm_paddr_t  high,
u_long  alignment,
vm_paddr_t  boundary,
vm_memattr_t  memattr 
)

◆ vm_page_alloc_noobj_domain()

vm_page_t vm_page_alloc_noobj_domain ( int  domain,
int  req 
)

Definition at line 2445 of file vm_page.c.

References _vm_page_alloc_noobj_domain().

Referenced by noobj_alloc(), pcpu_page_alloc(), and vm_page_alloc_noobj().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_astate_fcmpset()

static bool vm_page_astate_fcmpset ( vm_page_t  m,
vm_page_astate_t old,
vm_page_astate_t  new 
)
inlinestatic

Definition at line 823 of file vm_page.h.

References vm_page_astate::_bits, PGA_ENQUEUED, PGA_REQUEUE_HEAD, PQ_INACTIVE, and PQ_NONE.

Referenced by vm_page_pqstate_fcmpset().

Here is the caller graph for this function:

◆ vm_page_astate_load()

◆ vm_page_bits()

vm_page_bits_t vm_page_bits ( int  base,
int  size 
)

◆ vm_page_bits_set()

void vm_page_bits_set ( vm_page_t  m,
vm_page_bits_t *  bits,
vm_page_bits_t  set 
)

Definition at line 4950 of file vm_page.c.

Referenced by vm_page_set_valid_range(), vm_page_set_validclean(), vm_page_valid(), and vnode_pager_input_smlfs().

Here is the caller graph for this function:

◆ vm_page_blacklist_add()

bool vm_page_blacklist_add ( vm_paddr_t  pa,
bool  verbose 
)

Definition at line 326 of file vm_page.c.

References vm_domain_free_lock, vm_domain_free_unlock, vm_domain_freecnt_inc(), vm_pagequeue_domain(), vm_phys_paddr_to_vm_page(), and vm_phys_unfree_page().

Referenced by vm_page_blacklist_check().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_busy_acquire()

bool vm_page_busy_acquire ( vm_page_t  m,
int  allocflags 
)

Definition at line 869 of file vm_page.c.

References _vm_page_busy_sleep(), VM_ALLOC_NOWAIT, VM_ALLOC_WAITFAIL, VM_OBJECT_WLOCK, VM_OBJECT_WOWNED, vm_page_tryacquire(), and vm_page_wired().

Referenced by dev_pager_dealloc(), sg_pager_dealloc(), swap_pager_swapoff_object(), vm_fault_copy_entry(), and vm_object_page_clean().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_busy_downgrade()

void vm_page_busy_downgrade ( vm_page_t  m)

Definition at line 909 of file vm_page.c.

References vm_page_assert_xbusied, vm_page_busy_fetch, VPB_BIT_WAITERS, and VPB_SHARERS_WORD.

Referenced by vm_page_grab_valid(), and vm_pageout_flush().

Here is the caller graph for this function:

◆ vm_page_busy_sleep()

bool vm_page_busy_sleep ( vm_page_t  m,
const char *  msg,
int  allocflags 
)

Definition at line 1014 of file vm_page.c.

References _vm_page_busy_sleep(), and VM_OBJECT_ASSERT_LOCKED.

Referenced by vm_fault_busy_sleep(), vm_object_collapse_scan_wait(), vm_object_madvise(), vm_object_page_remove(), vm_object_split(), and vm_object_unwire().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_busy_sleep_unlocked()

void vm_page_busy_sleep_unlocked ( vm_object_t  obj,
vm_page_t  m,
vm_pindex_t  pindex,
const char *  wmesg,
int  allocflags 
)

Definition at line 1038 of file vm_page.c.

References _vm_page_busy_sleep(), vm_page::pindex, and VM_OBJECT_ASSERT_UNLOCKED.

Here is the call graph for this function:

◆ vm_page_busy_tryupgrade()

int vm_page_busy_tryupgrade ( vm_page_t  m)

◆ vm_page_clear_dirty()

void vm_page_clear_dirty ( vm_page_t  m,
int  base,
int  size 
)

Definition at line 5264 of file vm_page.c.

References vm_page_bits(), and vm_page_clear_dirty_mask().

Referenced by vnode_pager_generic_putpages(), vnode_pager_subpage_purge(), and vnode_pager_undirty_pages().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_deactivate()

void vm_page_deactivate ( vm_page_t  m)

Definition at line 4170 of file vm_page.c.

References PGA_REQUEUE, PQ_INACTIVE, and vm_page_mvqueue().

Referenced by fault_page_release(), vm_fault_dontneed(), vm_fault_populate_cleanup(), vm_page_readahead_finish(), vm_page_reclaim_run(), and vm_swapout_object_deactivate_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_deactivate_noreuse()

void vm_page_deactivate_noreuse ( vm_page_t  m)

Definition at line 4177 of file vm_page.c.

References PGA_REQUEUE_HEAD, PQ_INACTIVE, and vm_page_mvqueue().

Referenced by swp_pager_async_iodone(), vm_object_page_noreuse(), vm_page_advise(), and vm_pageout_flush().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_dequeue()

void vm_page_dequeue ( vm_page_t  m)

◆ vm_page_dequeue_deferred()

void vm_page_dequeue_deferred ( vm_page_t  m)

Definition at line 3731 of file vm_page.c.

References vm_page_astate::flags, PGA_DEQUEUE, PGA_QUEUE_STATE_MASK, PQ_NONE, vm_page_astate::queue, vm_page_astate_load(), and vm_page_pqstate_commit_request().

Referenced by vm_page_free_prep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_dirty()

static __inline void vm_page_dirty ( vm_page_t  m)
static

Definition at line 885 of file vm_page.h.

References vm_page_dirty_KBI().

Referenced by kern_mincore(), swp_pager_force_dirty(), vm_fault_cow(), vm_fault_quick_hold_pages(), vm_page_advise(), vm_page_rename(), vm_page_test_dirty(), and vm_thread_swapout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_dirty_KBI()

void vm_page_dirty_KBI ( vm_page_t  m)

Definition at line 1413 of file vm_page.c.

References vm_page_all_valid().

Referenced by vm_page_dirty().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_domain()

static int vm_page_domain ( vm_page_t  m)
inlinestatic

◆ vm_page_drop()

static u_int vm_page_drop ( vm_page_t  m,
u_int  val 
)
inlinestatic

Definition at line 959 of file vm_page.h.

References VPRC_BLOCKED.

Referenced by vm_object_terminate_pages(), vm_page_remove_xbusy(), vm_page_replace_hold(), vm_page_try_blocked_op(), and vm_page_unwire_noq().

Here is the caller graph for this function:

◆ vm_page_find_least()

vm_page_t vm_page_find_least ( vm_object_t  object,
vm_pindex_t  pindex 
)

◆ vm_page_free()

◆ vm_page_free_invalid()

void vm_page_free_invalid ( vm_page_t  m)

Definition at line 1375 of file vm_page.c.

References VM_OBJECT_ASSERT_WLOCKED, vm_page_free(), vm_page_none_valid(), vm_page_remove(), and vm_page_xbusy_claim.

Referenced by vnode_pager_generic_getpages_done().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_free_pages_toq()

void vm_page_free_pages_toq ( struct spglist *  free,
bool  update_wire_count 
)

Definition at line 3941 of file vm_page.c.

References vm_page_free_toq().

Here is the call graph for this function:

◆ vm_page_free_zero()

void vm_page_free_zero ( vm_page_t  m)

Definition at line 1339 of file vm_page.c.

References PG_ZERO, and vm_page_free_toq().

Here is the call graph for this function:

◆ vm_page_getfake()

vm_page_t vm_page_getfake ( vm_paddr_t  paddr,
vm_memattr_t  memattr 
)

Definition at line 1252 of file vm_page.c.

References uma_zalloc(), and vm_page_initfake().

Referenced by old_dev_pager_fault(), and sg_pager_getpages().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_grab()

vm_page_t vm_page_grab ( vm_object_t  object,
vm_pindex_t  pindex,
int  allocflags 
)

◆ vm_page_grab_pages()

int vm_page_grab_pages ( vm_object_t  object,
vm_pindex_t  pindex,
int  allocflags,
vm_page_t *  ma,
int  count 
)

◆ vm_page_grab_pages_unlocked()

int vm_page_grab_pages_unlocked ( vm_object_t  object,
vm_pindex_t  pindex,
int  allocflags,
vm_page_t *  ma,
int  count 
)

◆ vm_page_grab_unlocked()

vm_page_t vm_page_grab_unlocked ( vm_object_t  object,
vm_pindex_t  pindex,
int  allocflags 
)

Definition at line 4612 of file vm_page.c.

References VM_ALLOC_NOCREAT, VM_OBJECT_WLOCK, VM_OBJECT_WUNLOCK, vm_page_acquire_unlocked(), vm_page_grab(), and vm_page_grab_check().

Here is the call graph for this function:

◆ vm_page_grab_valid()

◆ vm_page_grab_valid_unlocked()

int vm_page_grab_valid_unlocked ( vm_page_t *  mp,
vm_object_t  object,
vm_pindex_t  pindex,
int  allocflags 
)

◆ vm_page_in_laundry()

static bool vm_page_in_laundry ( vm_page_t  m)
inlinestatic

Definition at line 945 of file vm_page.h.

References PQ_LAUNDRY, PQ_UNSWAPPABLE, and vm_page_queue().

Referenced by vm_page_advise(), vm_pageout_clean(), vm_pageout_cluster(), and vm_pageout_flush().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_inactive()

static bool vm_page_inactive ( vm_page_t  m)
inlinestatic

Definition at line 938 of file vm_page.h.

References PQ_INACTIVE, and vm_page_queue().

Referenced by vm_fault_dontneed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_init_marker()

void vm_page_init_marker ( vm_page_t  marker,
int  queue,
uint16_t  aflags 
)

Definition at line 428 of file vm_page.c.

References PG_MARKER, and VPB_CURTHREAD_EXCLUSIVE.

Referenced by vm_page_domain_init(), and vm_pageout_scan_inactive().

Here is the caller graph for this function:

◆ vm_page_init_page()

void vm_page_init_page ( vm_page_t  m,
vm_paddr_t  pa,
int  segind 
)

Definition at line 500 of file vm_page.c.

References pmap_page_init(), PQ_NONE, and VPB_FREED.

Referenced by vm_page_startup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_initfake()

void vm_page_initfake ( vm_page_t  m,
vm_paddr_t  paddr,
vm_memattr_t  memattr 
)

Definition at line 1262 of file vm_page.c.

References PG_FICTITIOUS, pmap_page_init(), PQ_NONE, VPB_CURTHREAD_EXCLUSIVE, and VPO_UNMANAGED.

Referenced by vm_page_getfake(), and vm_phys_fictitious_init_range().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_insert()

int vm_page_insert ( vm_page_t  m,
vm_object_t  object,
vm_pindex_t  pindex 
)

Definition at line 1429 of file vm_page.c.

References vm_page::object, vm_page::pindex, vm_object::rtree, VM_OBJECT_ASSERT_WLOCKED, vm_page_insert_after(), and vm_radix_lookup_le().

Here is the call graph for this function:

◆ vm_page_invalid()

void vm_page_invalid ( vm_page_t  m)

Definition at line 5318 of file vm_page.c.

References VM_OBJECT_ASSERT_WLOCKED, vm_page_assert_busied, vm_page_bits_clear(), and vm_page_xbusied.

Referenced by swp_pager_async_iodone(), and vm_object_page_remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_is_valid()

int vm_page_is_valid ( vm_page_t  m,
int  base,
int  size 
)

Definition at line 5386 of file vm_page.c.

References vm_page_bits().

Here is the call graph for this function:

◆ vm_page_launder()

void vm_page_launder ( vm_page_t  m)

Definition at line 4187 of file vm_page.c.

References PGA_REQUEUE, PQ_LAUNDRY, and vm_page_mvqueue().

Referenced by swp_pager_force_dirty(), vm_page_advise(), vm_pageout_launder(), and vm_pageout_scan_inactive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_lock_KBI()

void vm_page_lock_KBI ( vm_page_t  m,
const char *  file,
int  line 
)

Definition at line 5464 of file vm_page.c.

References vm_page_lockptr.

◆ vm_page_lookup()

◆ vm_page_lookup_unlocked()

vm_page_t vm_page_lookup_unlocked ( vm_object_t  object,
vm_pindex_t  pindex 
)

Definition at line 1643 of file vm_page.c.

References vm_page::object, vm_page::pindex, vm_object::rtree, and vm_radix_lookup_unlocked().

Here is the call graph for this function:

◆ vm_page_next()

vm_page_t vm_page_next ( vm_page_t  m)

◆ vm_page_none_valid()

◆ vm_page_pqbatch_drain()

void vm_page_pqbatch_drain ( void  )

Definition at line 3692 of file vm_page.c.

References PQ_COUNT, VM_DOMAIN, vm_ndomains, vm_pagequeue_lock, vm_pagequeue_unlock, vm_pqbatch_process(), and vm_domain::vmd_pagequeues.

Referenced by vm_daemon().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_pqbatch_submit()

void vm_page_pqbatch_submit ( vm_page_t  m,
uint8_t  queue 
)

Definition at line 3657 of file vm_page.c.

References PQ_COUNT, vm_batchqueue_insert(), VM_DOMAIN, vm_page_domain(), vm_pagequeue_lock, vm_pagequeue_unlock, vm_pqbatch_process(), and vm_pqbatch_process_page().

Referenced by vm_page_enqueue(), vm_page_pqstate_commit(), vm_page_pqstate_commit_request(), and vm_pageout_defer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_pqstate_commit()

bool vm_page_pqstate_commit ( vm_page_t  m,
vm_page_astate_t old,
vm_page_astate_t  new 
)

◆ vm_page_prev()

vm_page_t vm_page_prev ( vm_page_t  m)

Definition at line 1745 of file vm_page.c.

References VM_OBJECT_ASSERT_LOCKED.

Referenced by vm_object_page_collect_flush(), and vm_pageout_cluster().

Here is the caller graph for this function:

◆ vm_page_ps_test()

bool vm_page_ps_test ( vm_page_t  m,
int  flags,
vm_page_t  skip_m 
)

Definition at line 5399 of file vm_page.c.

References PS_ALL_DIRTY, PS_ALL_VALID, PS_NONE_BUSY, VM_OBJECT_ASSERT_LOCKED, and vm_page_busied.

Referenced by vm_fault_soft_fast(), and vm_map_pmap_enter().

Here is the caller graph for this function:

◆ vm_page_putfake()

void vm_page_putfake ( vm_page_t  m)

Definition at line 1293 of file vm_page.c.

References PG_FICTITIOUS, uma_zfree(), vm_page_assert_xbusied, vm_page_busy_free(), and VPO_UNMANAGED.

Referenced by dev_pager_free_page(), and sg_pager_dealloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_queue()

static uint8_t vm_page_queue ( vm_page_t  m)
inlinestatic

Definition at line 924 of file vm_page.h.

References _vm_page_queue(), and vm_page_astate_load().

Referenced by vm_page_active(), vm_page_in_laundry(), vm_page_inactive(), vm_page_reclaim_run(), and vm_page_scan_contig().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_readahead_finish()

void vm_page_readahead_finish ( vm_page_t  m)

Definition at line 1351 of file vm_page.c.

References vm_page_activate(), vm_page_busy_fetch, vm_page_deactivate(), vm_page_none_valid(), vm_page_xunbusy_unchecked, and VPB_BIT_WAITERS.

Referenced by swp_pager_async_iodone(), vm_page_grab_valid(), and vnode_pager_generic_getpages_done().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_reclaim_contig()

bool vm_page_reclaim_contig ( int  req,
u_long  npages,
vm_paddr_t  low,
vm_paddr_t  high,
u_long  alignment,
vm_paddr_t  boundary 
)

Definition at line 3122 of file vm_page.c.

References vm_domainset_iter_page(), vm_domainset_iter_page_init(), and vm_page_reclaim_contig_domain().

Here is the call graph for this function:

◆ vm_page_reclaim_contig_domain()

bool vm_page_reclaim_contig_domain ( int  domain,
int  req,
u_long  npages,
vm_paddr_t  low,
vm_paddr_t  high,
u_long  alignment,
vm_paddr_t  boundary 
)

◆ vm_page_reference()

void vm_page_reference ( vm_page_t  m)

Definition at line 821 of file vm_page.c.

References PGA_REFERENCED, and vm_page_aflag_set().

Referenced by vm_page_grab_sleep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_release()

void vm_page_release ( vm_page_t  m,
int  flags 
)

Definition at line 4256 of file vm_page.c.

References PQ_INACTIVE, VM_OBJECT_TRYWLOCK, VM_OBJECT_WUNLOCK, vm_page_busied, vm_page_release_locked(), vm_page_unwire_managed(), VPO_UNMANAGED, and VPR_TRYFREE.

Here is the call graph for this function:

◆ vm_page_release_locked()

void vm_page_release_locked ( vm_page_t  m,
int  flags 
)

Definition at line 4284 of file vm_page.c.

References PQ_INACTIVE, VM_OBJECT_ASSERT_WLOCKED, vm_page_free(), vm_page_release_toq(), vm_page_tryxbusy(), vm_page_unwire_noq(), vm_page_wired(), vm_page_xunbusy, VPO_UNMANAGED, and VPR_TRYFREE.

Referenced by vm_page_release().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_relookup()

vm_page_t vm_page_relookup ( vm_object_t  object,
vm_pindex_t  pindex 
)

Definition at line 1656 of file vm_page.c.

References vm_page::object, vm_page::pindex, vm_object::rtree, vm_page_busied, vm_page_wired(), and vm_radix_lookup_unlocked().

Referenced by vm_pager_get_pages().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_remove()

bool vm_page_remove ( vm_page_t  m)

Definition at line 1594 of file vm_page.c.

References vm_page_remove_xbusy(), and vm_page_xunbusy.

Referenced by cdev_pager_free_page(), vm_object_collapse_scan(), vm_object_split(), and vm_page_free_invalid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_remove_xbusy()

bool vm_page_remove_xbusy ( vm_page_t  m)

Definition at line 1611 of file vm_page.c.

References vm_page_drop(), vm_page_object_remove(), and VPRC_OBJREF.

Referenced by vm_fault_cow(), and vm_page_remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_rename()

int vm_page_rename ( vm_page_t  m,
vm_object_t  new_object,
vm_pindex_t  new_pindex 
)

Definition at line 1845 of file vm_page.c.

References vm_object::rtree, VM_OBJECT_ASSERT_WLOCKED, vm_page_dirty(), vm_page_insert_radixdone(), vm_page_object_remove(), vm_radix_insert(), and vm_radix_lookup_le().

Referenced by vm_object_collapse_scan(), and vm_object_split().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_replace()

void vm_page_replace ( vm_page_t  mnew,
vm_object_t  object,
vm_pindex_t  pindex,
vm_page_t  mold 
)

Definition at line 1816 of file vm_page.c.

References vm_page::pindex, vm_page_assert_xbusied, vm_page_free(), and vm_page_replace_hold().

Referenced by old_dev_pager_fault(), sg_pager_getpages(), and vm_fault_cow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_sbusied()

int vm_page_sbusied ( vm_page_t  m)

Definition at line 958 of file vm_page.c.

References vm_page_busy_fetch, VPB_BIT_SHARED, and VPB_UNBUSIED.

◆ vm_page_scan_contig()

vm_page_t vm_page_scan_contig ( u_long  npages,
vm_page_t  m_start,
vm_page_t  m_end,
u_long  alignment,
vm_paddr_t  boundary,
int  options 
)

◆ vm_page_set_dirty()

vm_page_bits_t vm_page_set_dirty ( vm_page_t  m)

Definition at line 5133 of file vm_page.c.

References PGA_SWAP_SPACE, vm_page_bits_swap(), VM_PAGE_OBJECT_BUSY_ASSERT, vm_page_xbusied, and vm_pager_page_unswapped().

Referenced by vm_fault_dirty().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_set_invalid()

void vm_page_set_invalid ( vm_page_t  m,
int  base,
int  size 
)

◆ vm_page_set_valid_range()

void vm_page_set_valid_range ( vm_page_t  m,
int  base,
int  size 
)

Definition at line 5082 of file vm_page.c.

References pmap_zero_page_area(), vm_page_assert_busied, vm_page_bits(), vm_page_bits_set(), and vm_page_xbusied.

Referenced by vnode_pager_generic_getpages_done(), and vnode_pager_subpage_purge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_set_validclean()

void vm_page_set_validclean ( vm_page_t  m,
int  base,
int  size 
)

◆ vm_page_startup()

◆ vm_page_sunbusy()

void vm_page_sunbusy ( vm_page_t  m)

◆ vm_page_test_dirty()

void vm_page_test_dirty ( vm_page_t  m)

Definition at line 5444 of file vm_page.c.

References pmap_is_modified(), vm_page_assert_busied, and vm_page_dirty().

Referenced by vm_pageout_cluster(), vm_pageout_launder(), and vm_pageout_scan_inactive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_try_remove_all()

bool vm_page_try_remove_all ( vm_page_t  m)

Definition at line 4348 of file vm_page.c.

References pmap_remove_all(), and vm_page_try_blocked_op().

Referenced by vm_object_page_remove(), vm_page_reclaim_run(), vm_pageout_launder(), vm_pageout_scan_inactive(), and vm_swapout_object_deactivate_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_try_remove_write()

bool vm_page_try_remove_write ( vm_page_t  m)

Definition at line 4358 of file vm_page.c.

References pmap_remove_write(), and vm_page_try_blocked_op().

Referenced by vm_object_page_remove(), vm_pageout_clean(), and vm_pageout_cluster().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_trylock_KBI()

int vm_page_trylock_KBI ( vm_page_t  m,
const char *  file,
int  line 
)

Definition at line 5478 of file vm_page.c.

References vm_page_lockptr.

◆ vm_page_trysbusy()

int vm_page_trysbusy ( vm_page_t  m)

Definition at line 1113 of file vm_page.c.

References vm_object_busied(), vm_page_busy_fetch, vm_page_sunbusy(), VPB_BIT_SHARED, and VPB_ONE_SHARER.

Referenced by vm_object_unwire(), and vm_page_trybusy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_tryxbusy()

◆ vm_page_undirty()

static __inline void vm_page_undirty ( vm_page_t  m)
static

Definition at line 902 of file vm_page.h.

References VM_PAGE_OBJECT_BUSY_ASSERT.

Referenced by swp_pager_async_iodone(), vm_object_page_remove(), vm_page_advise(), vm_page_free_prep(), vm_pageout_flush(), and vnode_pager_undirty_pages().

Here is the caller graph for this function:

◆ vm_page_unhold_pages()

void vm_page_unhold_pages ( vm_page_t *  ma,
int  count 
)

Definition at line 1211 of file vm_page.c.

References PQ_ACTIVE, and vm_page_unwire().

Here is the call graph for this function:

◆ vm_page_unlock_KBI()

void vm_page_unlock_KBI ( vm_page_t  m,
const char *  file,
int  line 
)

Definition at line 5471 of file vm_page.c.

References vm_page_lockptr.

◆ vm_page_unswappable()

void vm_page_unswappable ( vm_page_t  m)

Definition at line 4197 of file vm_page.c.

References PQ_UNSWAPPABLE, vm_page_dequeue(), vm_page_enqueue(), vm_page_wired(), and VPO_UNMANAGED.

Referenced by vm_pageout_flush().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_unwire()

void vm_page_unwire ( vm_page_t  m,
uint8_t  queue 
)

Definition at line 4079 of file vm_page.c.

References PQ_COUNT, vm_page_free(), vm_page_unwire_managed(), vm_page_unwire_noq(), and VPO_UNMANAGED.

Referenced by vm_fault_copy_entry(), vm_fault_cow(), vm_fault_quick_hold_pages(), vm_imgact_unmap_page(), vm_object_unwire(), vm_page_unhold_pages(), and vm_thread_swapout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_unwire_noq()

bool vm_page_unwire_noq ( vm_page_t  m)

Definition at line 4101 of file vm_page.c.

References PG_FICTITIOUS, PGA_DEQUEUE, vm_page_aflag_clear(), vm_page_drop(), VPO_UNMANAGED, and VPRC_WIRE_COUNT.

Referenced by _kmem_unback(), noobj_alloc(), pcpu_page_alloc(), pcpu_page_free(), startup_free(), vm_page_release_locked(), vm_page_unwire(), and vm_thread_stack_dispose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_page_updatefake()

void vm_page_updatefake ( vm_page_t  m,
vm_paddr_t  paddr,
vm_memattr_t  memattr 
)

Definition at line 1311 of file vm_page.c.

References PG_FICTITIOUS.

Referenced by old_dev_pager_fault().

Here is the caller graph for this function:

◆ vm_page_valid()

◆ vm_page_wire()

◆ vm_page_wire_mapped()

bool vm_page_wire_mapped ( vm_page_t  m)

Definition at line 3996 of file vm_page.c.

References PGA_DEQUEUE, vm_page_aflag_set(), VPO_UNMANAGED, VPRC_BLOCKED, and VPRC_WIRE_COUNT.

Here is the call graph for this function:

◆ vm_page_wired()

◆ vm_page_xunbusy_hard()

void vm_page_xunbusy_hard ( vm_page_t  m)

Definition at line 1181 of file vm_page.c.

References vm_page_assert_xbusied, and vm_page_xunbusy_hard_tail().

Here is the call graph for this function:

◆ vm_page_xunbusy_hard_unchecked()

void vm_page_xunbusy_hard_unchecked ( vm_page_t  m)

Definition at line 1188 of file vm_page.c.

References vm_page_assert_xbusied_unchecked, and vm_page_xunbusy_hard_tail().

Here is the call graph for this function:

◆ vm_page_zero_invalid()

void vm_page_zero_invalid ( vm_page_t  m,
boolean_t  setvalid 
)

Definition at line 5343 of file vm_page.c.

References pmap_zero_page_area(), and vm_page_valid().

Referenced by default_phys_pager_populate(), vm_page_grab_valid(), and vm_pager_get_pages().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ bogus_page

vm_page_t bogus_page
extern

◆ first_page

long first_page
extern

◆ pa_lock

struct mtx_padalign pa_lock[]
extern

Definition at line 121 of file vm_page.c.

Referenced by vm_page_startup().

◆ vm_page_array

vm_page_t vm_page_array
extern

◆ vm_page_array_size