During traversal of the active queue by vm_pageout_page_stats(), try

locking the page's containing object before accessing the page's flags.
This commit is contained in:
alc 2004-10-30 23:30:53 +00:00
parent 65e0f8cbf2
commit 1d3562b102

View File

@ -1241,6 +1241,7 @@ vm_pageout_scan(int pass)
static void
vm_pageout_page_stats()
{
vm_object_t object;
vm_page_t m,next;
int pcount,tpcount; /* Number of pages to check */
static int fullintervalcount = 0;
@ -1272,12 +1273,20 @@ vm_pageout_page_stats()
("vm_pageout_page_stats: page %p isn't active", m));
next = TAILQ_NEXT(m, pageq);
object = m->object;
if (!VM_OBJECT_TRYLOCK(object)) {
vm_pageq_requeue(m);
m = next;
continue;
}
/*
* Don't deactivate pages that are busy.
*/
if ((m->busy != 0) ||
(m->flags & PG_BUSY) ||
(m->hold_count != 0)) {
VM_OBJECT_UNLOCK(object);
vm_pageq_requeue(m);
m = next;
continue;
@ -1313,7 +1322,7 @@ vm_pageout_page_stats()
vm_pageq_requeue(m);
}
}
VM_OBJECT_UNLOCK(object);
m = next;
}
}