Change the page's CLEANCHK flag from being a page queue mutex synchronized

flag to a vm object mutex synchronized flag.
This commit is contained in:
alc 2007-02-22 06:15:52 +00:00
parent a9d90540f4
commit e4e74de1c2
2 changed files with 16 additions and 16 deletions

View File

@ -803,7 +803,7 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int
*/
clearobjflags = 1;
TAILQ_FOREACH(p, &object->memq, listq) {
vm_page_flag_set(p, PG_CLEANCHK);
p->oflags |= VPO_CLEANCHK;
if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC))
clearobjflags = 0;
else
@ -833,17 +833,17 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int
again:
pi = p->pindex;
if (((p->flags & PG_CLEANCHK) == 0) ||
if ((p->oflags & VPO_CLEANCHK) == 0 ||
(pi < tstart) || (pi >= tend) ||
(p->valid == 0) ||
VM_PAGE_INQUEUE1(p, PQ_CACHE)) {
vm_page_flag_clear(p, PG_CLEANCHK);
p->oflags &= ~VPO_CLEANCHK;
continue;
}
vm_page_test_dirty(p);
if ((p->dirty & p->valid) == 0) {
vm_page_flag_clear(p, PG_CLEANCHK);
p->oflags &= ~VPO_CLEANCHK;
continue;
}
@ -853,7 +853,7 @@ vm_object_page_clean(vm_object_t object, vm_pindex_t start, vm_pindex_t end, int
* not cleared in this case so we do not have to set them.
*/
if ((flags & OBJPC_NOSYNC) && (p->oflags & VPO_NOSYNC)) {
vm_page_flag_clear(p, PG_CLEANCHK);
p->oflags &= ~VPO_CLEANCHK;
continue;
}
@ -911,16 +911,16 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration,
if ((tp = vm_page_lookup(object, pi + i)) != NULL) {
if ((tp->oflags & VPO_BUSY) ||
((pagerflags & VM_PAGER_IGNORE_CLEANCHK) == 0 &&
(tp->flags & PG_CLEANCHK) == 0) ||
(tp->oflags & VPO_CLEANCHK) == 0) ||
(tp->busy != 0))
break;
if (VM_PAGE_INQUEUE1(tp, PQ_CACHE)) {
vm_page_flag_clear(tp, PG_CLEANCHK);
tp->oflags &= ~VPO_CLEANCHK;
break;
}
vm_page_test_dirty(tp);
if ((tp->dirty & tp->valid) == 0) {
vm_page_flag_clear(tp, PG_CLEANCHK);
tp->oflags &= ~VPO_CLEANCHK;
break;
}
maf[ i - 1 ] = tp;
@ -939,16 +939,16 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration,
if ((tp = vm_page_lookup(object, pi - i)) != NULL) {
if ((tp->oflags & VPO_BUSY) ||
((pagerflags & VM_PAGER_IGNORE_CLEANCHK) == 0 &&
(tp->flags & PG_CLEANCHK) == 0) ||
(tp->oflags & VPO_CLEANCHK) == 0) ||
(tp->busy != 0))
break;
if (VM_PAGE_INQUEUE1(tp, PQ_CACHE)) {
vm_page_flag_clear(tp, PG_CLEANCHK);
tp->oflags &= ~VPO_CLEANCHK;
break;
}
vm_page_test_dirty(tp);
if ((tp->dirty & tp->valid) == 0) {
vm_page_flag_clear(tp, PG_CLEANCHK);
tp->oflags &= ~VPO_CLEANCHK;
break;
}
mab[ i - 1 ] = tp;
@ -962,14 +962,14 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration,
for(i = 0; i < maxb; i++) {
int index = (maxb - i) - 1;
ma[index] = mab[i];
vm_page_flag_clear(ma[index], PG_CLEANCHK);
ma[index]->oflags &= ~VPO_CLEANCHK;
}
vm_page_flag_clear(p, PG_CLEANCHK);
p->oflags &= ~VPO_CLEANCHK;
ma[maxb] = p;
for(i = 0; i < maxf; i++) {
int index = (maxb + i) + 1;
ma[index] = maf[i];
vm_page_flag_clear(ma[index], PG_CLEANCHK);
ma[index]->oflags &= ~VPO_CLEANCHK;
}
runlen = maxb + maxf + 1;
@ -977,7 +977,7 @@ vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int curgeneration,
for (i = 0; i < runlen; i++) {
if (ma[i]->valid & ma[i]->dirty) {
pmap_remove_write(ma[i]);
vm_page_flag_set(ma[i], PG_CLEANCHK);
ma[i]->oflags |= VPO_CLEANCHK;
/*
* maxf will end up being the actual number of pages

View File

@ -144,6 +144,7 @@ struct vm_page {
*/
#define VPO_BUSY 0x0001 /* page is in transit */
#define VPO_WANTED 0x0002 /* someone is waiting for page */
#define VPO_CLEANCHK 0x0100 /* page will be checked for cleaning */
#define VPO_SWAPINPROG 0x0200 /* swap I/O in progress on page */
#define VPO_NOSYNC 0x0400 /* do not collect for syncer */
@ -226,7 +227,6 @@ extern struct pq_coloring page_queue_coloring;
#define PG_WRITEABLE 0x0010 /* page is mapped writeable */
#define PG_ZERO 0x0040 /* page is zeroed */
#define PG_REFERENCED 0x0080 /* page has been referenced */
#define PG_CLEANCHK 0x0100 /* page will be checked for cleaning */
#define PG_UNMANAGED 0x0800 /* No PV management for page */
#define PG_MARKER 0x1000 /* special queue marker page */
#define PG_SLAB 0x2000 /* object pointer is actually a slab */