Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_phys.h
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
vm_page_t vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low, | vm_page_t vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low, | ||||
vm_paddr_t high, u_long alignment, vm_paddr_t boundary, int options); | vm_paddr_t high, u_long alignment, vm_paddr_t boundary, int options); | ||||
void vm_phys_set_pool(int pool, vm_page_t m, int order); | void vm_phys_set_pool(int pool, vm_page_t m, int order); | ||||
boolean_t vm_phys_unfree_page(vm_page_t m); | boolean_t vm_phys_unfree_page(vm_page_t m); | ||||
int vm_phys_mem_affinity(int f, int t); | int vm_phys_mem_affinity(int f, int t); | ||||
/* | /* | ||||
* | * | ||||
* vm_phys_domidx: | * vm_phys_domain: | ||||
* | * | ||||
* Return the index of the domain the page belongs to. | * Return the index of the domain the page belongs to. | ||||
*/ | */ | ||||
static inline int | static inline int | ||||
vm_phys_domidx(vm_page_t m) | vm_phys_domain(vm_page_t m) | ||||
jeff: I really dislike this name. I think the new scheme makes sense. | |||||
{ | { | ||||
#ifdef NUMA | #ifdef NUMA | ||||
int domn, segind; | int domn, segind; | ||||
/* XXXKIB try to assert that the page is managed */ | /* XXXKIB try to assert that the page is managed */ | ||||
segind = m->segind; | segind = m->segind; | ||||
KASSERT(segind < vm_phys_nsegs, ("segind %d m %p", segind, m)); | KASSERT(segind < vm_phys_nsegs, ("segind %d m %p", segind, m)); | ||||
domn = vm_phys_segs[segind].domain; | domn = vm_phys_segs[segind].domain; | ||||
KASSERT(domn < vm_ndomains, ("domain %d m %p", domn, m)); | KASSERT(domn < vm_ndomains, ("domain %d m %p", domn, m)); | ||||
return (domn); | return (domn); | ||||
#else | #else | ||||
return (0); | return (0); | ||||
#endif | #endif | ||||
} | |||||
/* | |||||
* vm_phys_domain: | |||||
* | |||||
* Return the memory domain the page belongs to. | |||||
*/ | |||||
static inline struct vm_domain * | |||||
vm_phys_domain(vm_page_t m) | |||||
{ | |||||
return (&vm_dom[vm_phys_domidx(m)]); | |||||
} | |||||
static inline u_int | |||||
vm_phys_freecnt_adj(vm_page_t m, int adj) | |||||
{ | |||||
mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); | |||||
vm_phys_domain(m)->vmd_free_count += adj; | |||||
return (vm_cnt.v_free_count += adj); | |||||
} | } | ||||
#endif /* _KERNEL */ | #endif /* _KERNEL */ | ||||
#endif /* !_VM_PHYS_H_ */ | #endif /* !_VM_PHYS_H_ */ |
I really dislike this name. I think the new scheme makes sense.