summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_pageout.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-09-08 20:44:49 +0000
committerdyson <dyson@FreeBSD.org>1996-09-08 20:44:49 +0000
commit62b009f8b179a95d34929daf49b97c99e358547a (patch)
treea5425fa8640477891a0e0f4021726b6e38c00d71 /sys/vm/vm_pageout.c
parentb9342257a10d75fd22b9d4495acaf88d88a0728a (diff)
downloadFreeBSD-src-62b009f8b179a95d34929daf49b97c99e358547a.zip
FreeBSD-src-62b009f8b179a95d34929daf49b97c99e358547a.tar.gz
Addition of page coloring support. Various levels of coloring are afforded.
The default level works with minimal overhead, but one can also enable full, efficient use of a 512K cache. (Parameters can be generated to support arbitrary cache sizes also.)
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r--sys/vm/vm_pageout.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index d4db0bc..12f7feb 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.83 1996/07/27 03:24:08 dyson Exp $
+ * $Id: vm_pageout.c,v 1.84 1996/07/30 03:08:19 dyson Exp $
*/
/*
@@ -256,7 +256,8 @@ vm_pageout_clean(m, sync)
}
p = vm_page_lookup(object, pindex + i);
if (p) {
- if ((p->queue == PQ_CACHE) || (p->flags & PG_BUSY) || p->busy) {
+ if (((p->queue - p->pc) == PQ_CACHE) ||
+ (p->flags & PG_BUSY) || p->busy) {
forward_okay = FALSE;
goto do_backward;
}
@@ -290,7 +291,8 @@ do_backward:
}
p = vm_page_lookup(object, pindex - i);
if (p) {
- if ((p->queue == PQ_CACHE) || (p->flags & PG_BUSY) || p->busy) {
+ if (((p->queue - p->pc) == PQ_CACHE) ||
+ (p->flags & PG_BUSY) || p->busy) {
backward_okay = FALSE;
continue;
}
@@ -831,9 +833,11 @@ rescan0:
* code to be guaranteed space.
*/
while (cnt.v_free_count < cnt.v_free_reserved) {
- m = TAILQ_FIRST(&vm_page_queue_cache);
+ static int cache_rover = 0;
+ m = vm_page_list_find(PQ_CACHE, cache_rover);
if (!m)
break;
+ cache_rover = (cache_rover + PQ_PRIME2) & PQ_L2_MASK;
vm_page_free(m);
cnt.v_dfree++;
}
@@ -928,7 +932,7 @@ vm_size_t count;
cnt.v_interrupt_free_min;
cnt.v_free_reserved = vm_pageout_page_count +
cnt.v_pageout_free_min + (count / 768);
- cnt.v_free_min += cnt.v_free_reserved;
+ cnt.v_free_min += cnt.v_free_reserved + PQ_L2_SIZE;
return 1;
}
OpenPOWER on IntegriCloud