summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-05-24 05:19:15 +0000
committerdyson <dyson@FreeBSD.org>1996-05-24 05:19:15 +0000
commit55bfe202846042331cd2ed94c7277325278c04ef (patch)
tree967d4a35a05e79e8b680e51aaad7f0938ce64e0d /sys
parent992a2cacdcd25ca37b429968cfc112d31325bffd (diff)
downloadFreeBSD-src-55bfe202846042331cd2ed94c7277325278c04ef.zip
FreeBSD-src-55bfe202846042331cd2ed94c7277325278c04ef.tar.gz
Add apparently needed splvm protection to the active queue, and eliminate
an unnecessary test for dirty pages if it is already known to be dirty.
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_pageout.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 950ebe1..b6cf9d5 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -65,7 +65,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pageout.c,v 1.70 1996/04/11 21:05:25 bde Exp $
+ * $Id: vm_pageout.c,v 1.71 1996/05/18 03:38:00 dyson Exp $
*/
/*
@@ -390,6 +390,7 @@ vm_pageout_object_deactivate_pages(map, object, count, map_remove_only)
register vm_page_t p, next;
int rcount;
int dcount;
+ int s;
dcount = 0;
if (count == 0)
@@ -453,8 +454,10 @@ vm_pageout_object_deactivate_pages(map, object, count, map_remove_only)
pmap_clear_reference(VM_PAGE_TO_PHYS(p));
p->flags &= ~PG_REFERENCED;
+ s = splvm();
TAILQ_REMOVE(&vm_page_queue_active, p, pageq);
TAILQ_INSERT_TAIL(&vm_page_queue_active, p, pageq);
+ splx(s);
}
} else if (p->queue == PQ_INACTIVE) {
vm_page_protect(p, VM_PROT_NONE);
@@ -525,6 +528,7 @@ vm_pageout_scan()
int vnodes_skipped = 0;
int usagefloor;
int i;
+ int s;
pages_freed = 0;
@@ -665,6 +669,7 @@ rescan1:
}
pcount = cnt.v_active_count;
+ s = splvm();
m = TAILQ_FIRST(&vm_page_queue_active);
while ((m != NULL) && (pcount-- > 0) && (page_shortage > 0)) {
next = TAILQ_NEXT(m, pageq);
@@ -703,7 +708,8 @@ rescan1:
m->flags &= ~PG_REFERENCED;
if (page_shortage > 0) {
--page_shortage;
- vm_page_test_dirty(m);
+ if (m->dirty == 0)
+ vm_page_test_dirty(m);
if (m->dirty == 0) {
vm_page_cache(m);
} else {
@@ -714,6 +720,7 @@ rescan1:
}
m = next;
}
+ splx(s);
/*
* We try to maintain some *really* free pages, this allows interrupt
OpenPOWER on IntegriCloud