Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_page.c
Show First 20 Lines • Show All 3,472 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Returns true if all of the specified predicates are true for the entire | * Returns true if all of the specified predicates are true for the entire | ||||
* (super)page and false otherwise. | * (super)page and false otherwise. | ||||
*/ | */ | ||||
bool | bool | ||||
vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip_m) | vm_page_ps_test(vm_page_t m, int flags, vm_page_t skip_m) | ||||
{ | { | ||||
vm_object_t object; | |||||
int i, npages; | int i, npages; | ||||
VM_OBJECT_ASSERT_LOCKED(m->object); | object = m->object; | ||||
VM_OBJECT_ASSERT_LOCKED(object); | |||||
npages = atop(pagesizes[m->psind]); | npages = atop(pagesizes[m->psind]); | ||||
/* | /* | ||||
* The physically contiguous pages that make up a superpage, i.e., a | * The physically contiguous pages that make up a superpage, i.e., a | ||||
* page with a page size index ("psind") greater than zero, will | * page with a page size index ("psind") greater than zero, will | ||||
* occupy adjacent entries in vm_page_array[]. | * occupy adjacent entries in vm_page_array[]. | ||||
*/ | */ | ||||
for (i = 0; i < npages; i++) { | for (i = 0; i < npages; i++) { | ||||
/* Always test object consistency, including "skip_m". */ | |||||
if (m[i].object != object) | |||||
return (false); | |||||
if (&m[i] == skip_m) | if (&m[i] == skip_m) | ||||
continue; | continue; | ||||
if ((flags & PS_NONE_BUSY) != 0 && vm_page_busied(&m[i])) | if ((flags & PS_NONE_BUSY) != 0 && vm_page_busied(&m[i])) | ||||
return (false); | return (false); | ||||
if ((flags & PS_ALL_DIRTY) != 0) { | if ((flags & PS_ALL_DIRTY) != 0) { | ||||
/* | /* | ||||
* Calling vm_page_test_dirty() or pmap_is_modified() | * Calling vm_page_test_dirty() or pmap_is_modified() | ||||
* might stop this case from spuriously returning | * might stop this case from spuriously returning | ||||
▲ Show 20 Lines • Show All 157 Lines • Show Last 20 Lines |