version 1.55, 2008/06/04 15:06:04 |
version 1.55.14.9, 2012/02/29 18:03:39 |
Line 153 struct vm_page { |
|
Line 153 struct vm_page { |
|
pid_t owner; /* proc that set PG_BUSY */ |
pid_t owner; /* proc that set PG_BUSY */ |
lwpid_t lowner; /* lwp that set PG_BUSY */ |
lwpid_t lowner; /* lwp that set PG_BUSY */ |
const char *owner_tag; /* why it was set busy */ |
const char *owner_tag; /* why it was set busy */ |
|
const void *owner_addr; /* who allocated it */ |
#endif |
#endif |
}; |
}; |
|
|
Line 234 struct vm_physseg { |
|
Line 235 struct vm_physseg { |
|
paddr_t end; /* (PF# of last page in segment) + 1 */ |
paddr_t end; /* (PF# of last page in segment) + 1 */ |
paddr_t avail_start; /* PF# of first free page in segment */ |
paddr_t avail_start; /* PF# of first free page in segment */ |
paddr_t avail_end; /* (PF# of last free page in segment) +1 */ |
paddr_t avail_end; /* (PF# of last free page in segment) +1 */ |
int free_list; /* which free list they belong on */ |
|
struct vm_page *pgs; /* vm_page structures (from start) */ |
struct vm_page *pgs; /* vm_page structures (from start) */ |
struct vm_page *lastpg; /* vm_page structure for end */ |
struct vm_page *lastpg; /* vm_page structure for end */ |
|
int free_list; /* which free list they belong on */ |
|
u_int start_hint; /* start looking for free pages here */ |
|
/* protected by uvm_fpageqlock */ |
#ifdef __HAVE_PMAP_PHYSSEG |
#ifdef __HAVE_PMAP_PHYSSEG |
struct pmap_physseg pmseg; /* pmap specific (MD) data */ |
struct pmap_physseg pmseg; /* pmap specific (MD) data */ |
#endif |
#endif |
}; |
}; |
|
|
|
/* |
|
* Fields from uvmexp which need to be kept on a per-group basis. |
|
*/ |
|
struct uvm_pggroup { |
|
TAILQ_ENTRY(uvm_pggroup) pgrp_pending_link; |
|
TAILQ_ENTRY(uvm_pggroup) pgrp_paging_link; |
|
STAILQ_ENTRY(uvm_pggroup) pgrp_uvm_link; |
|
|
|
struct uvmpdpol_groupstate *pgrp_gs; /* for pdpolicy */ |
|
u_int pgrp_free_list; /* pages we manage are on this free_list */ |
|
u_int pgrp_color; /* color of the pages we manage */ |
|
|
|
/* vm_page counters */ |
|
u_int pgrp_npages; /* # of pages we manage */ |
|
u_int pgrp_free; /* # of free pages */ |
|
u_int pgrp_paging; /* # of pages in the process of being paged out */ |
|
u_int pgrp_wired; /* # of wired pages */ |
|
|
|
/* pageout params */ |
|
u_int pgrp_freemin; /* min number of free pages */ |
|
u_int pgrp_freetarg; /* target number of free pages */ |
|
u_int pgrp_wiredmax; /* max number of wired pages */ |
|
|
|
u_int pgrp_active; /* # of pages on the active q */ |
|
u_int pgrp_inactive; /* # of pages on the inactive q */ |
|
|
|
u_int pgrp_kmempages; /* # of pages used for kernel memory */ |
|
u_int pgrp_anonpages; /* # of pages used by anon mappings */ |
|
u_int pgrp_filepages; /* # of pages used by cached file data */ |
|
u_int pgrp_execpages; /* # of pages used by cached exec data */ |
|
|
|
/* internal stuff */ |
|
bool pgrp_scan_needed; /* this color needs pages to be reclaimed */ |
|
|
|
uint64_t pgrp_hints; /* # of hints for this page group */ |
|
uint64_t pgrp_hintfails; /* # of hints that failed */ |
|
|
|
/* page daemon counters */ |
|
uint64_t pgrp_pgswapout; /* # of pages swapped out */ |
|
uint64_t pgrp_pdrevs; /* # of times daemon rev'd clock hand */ |
|
uint64_t pgrp_pdswout; /* # of times daemon called for swapout */ |
|
uint64_t pgrp_pdfreed; /* # of pages daemon freed since boot */ |
|
uint64_t pgrp_pdscans; /* # of pages daemon scanned since boot */ |
|
uint64_t pgrp_pdanscan; /* # of anonymous pages scanned by daemon */ |
|
uint64_t pgrp_pdobscan; /* # of object pages scanned by daemon */ |
|
uint64_t pgrp_pdreact; /* # of pages daemon reactivated since boot */ |
|
uint64_t pgrp_pdbusy; /* # of times daemon found a busy page */ |
|
uint64_t pgrp_pdpageouts; /* # of times daemon started a pageout */ |
|
uint64_t pgrp_pdpending; /* # of times daemon got a pending pagout */ |
|
uint64_t pgrp_pddeact; /* # of pages daemon deactivates */ |
|
uint64_t pgrp_pdreanon; /* anon pages reactivated due to thresholds */ |
|
uint64_t pgrp_pdrefile; /* file pages reactivated due to thresholds */ |
|
uint64_t pgrp_pdreexec; /* executable pages reactivated due to thresholds */ |
|
uint64_t pgrp_pdnullscans; /* # of daemon scanned with no victims */ |
|
uint64_t pgrp_pdvictims; /* # of pages selected by the daemon */ |
|
uint64_t pgrp_pdputs; /* # of pages the daemon has "put" */ |
|
}; |
|
|
|
TAILQ_HEAD(uvm_pggrouplist, uvm_pggroup); |
|
|
#ifdef _KERNEL |
#ifdef _KERNEL |
|
|
/* |
/* |
Line 253 extern bool vm_page_zero_enable; |
|
Line 316 extern bool vm_page_zero_enable; |
|
/* |
/* |
* physical memory config is stored in vm_physmem. |
* physical memory config is stored in vm_physmem. |
*/ |
*/ |
|
#define VM_PHYSMEM_PTR(i) (&vm_physmem[i]) |
|
#define VM_PHYSMEM_PTR_SWAP(i, j) \ |
|
do { vm_physmem[(i)] = vm_physmem[(j)]; } while (0) |
|
|
extern struct vm_physseg vm_physmem[VM_PHYSSEG_MAX]; |
extern struct vm_physseg vm_physmem[VM_PHYSSEG_MAX]; |
extern int vm_nphysseg; |
extern int vm_nphysseg; |
Line 263 extern int vm_nphysseg; |
|
Line 329 extern int vm_nphysseg; |
|
|
|
void uvm_page_init(vaddr_t *, vaddr_t *); |
void uvm_page_init(vaddr_t *, vaddr_t *); |
#if defined(UVM_PAGE_TRKOWN) |
#if defined(UVM_PAGE_TRKOWN) |
void uvm_page_own(struct vm_page *, const char *); |
void uvm_page_own(struct vm_page *, const char *, const void *); |
#endif |
#endif |
#if !defined(PMAP_STEAL_MEMORY) |
#if !defined(PMAP_STEAL_MEMORY) |
bool uvm_page_physget(paddr_t *); |
bool uvm_page_physget(paddr_t *); |
Line 288 void uvm_pagewire(struct vm_page *); |
|
Line 354 void uvm_pagewire(struct vm_page *); |
|
void uvm_pagezero(struct vm_page *); |
void uvm_pagezero(struct vm_page *); |
|
|
int uvm_page_lookup_freelist(struct vm_page *); |
int uvm_page_lookup_freelist(struct vm_page *); |
|
struct uvm_pggroup *uvm_page_to_pggroup(struct vm_page *); |
|
|
static struct vm_page *PHYS_TO_VM_PAGE(paddr_t); |
static struct vm_page *PHYS_TO_VM_PAGE(paddr_t); |
static int vm_physseg_find(paddr_t, int *); |
static int vm_physseg_find(paddr_t, int *); |
Line 301 static int vm_physseg_find(paddr_t, int |
|
Line 368 static int vm_physseg_find(paddr_t, int |
|
#define uvm_pagehash(obj,off) \ |
#define uvm_pagehash(obj,off) \ |
(((unsigned long)obj+(unsigned long)atop(off)) & uvm.page_hashmask) |
(((unsigned long)obj+(unsigned long)atop(off)) & uvm.page_hashmask) |
|
|
#define VM_PAGE_TO_PHYS(entry) ((entry)->phys_addr) |
#define VM_PAGE_TO_PHYS(pg) ((pg)->phys_addr) |
|
|
|
#ifdef __HAVE_VM_PAGE_MD |
|
#define VM_PAGE_TO_MD(pg) (&(pg)->mdpage) |
|
#endif |
|
|
/* |
/* |
* Compute the page color bucket for a given page. |
* Compute the page color bucket for a given page. |