summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2007-02-22 06:15:52 +0000
committeralc <alc@FreeBSD.org>2007-02-22 06:15:52 +0000
commite4e74de1c278ee8f4f1b1780e8225ecc7cbbd084 (patch)
treef9b6e15f78a25a0473fc1048b6a7386b3d4d3079 /sys/vm
parenta9d90540f47ebe7ae8313f0ed9140c085b63483a (diff)
downloadFreeBSD-src-e4e74de1c278ee8f4f1b1780e8225ecc7cbbd084.zip
FreeBSD-src-e4e74de1c278ee8f4f1b1780e8225ecc7cbbd084.tar.gz
Change the page's CLEANCHK flag from being a page queue mutex synchronized
flag to a vm object mutex synchronized flag.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.c30
-rw-r--r--sys/vm/vm_page.h2
2 files changed, 16 insertions, 16 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 72a5bb1..ce42b99 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -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 @@ rescan:
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 @@ again:
* 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
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 91e11eb..a3ab085 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -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 */
OpenPOWER on IntegriCloud