summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-02-08 00:37:36 +0000
committerdillon <dillon@FreeBSD.org>1999-02-08 00:37:36 +0000
commitb7a0b99c31ad20c9d83cd00f353e622a25f80182 (patch)
tree287ab6f615e494be7a3958316918da47ac087e12 /sys/powerpc
parent3e732af5eab8cbd6d41b59b62aa54411e81cd91c (diff)
downloadFreeBSD-src-b7a0b99c31ad20c9d83cd00f353e622a25f80182.zip
FreeBSD-src-b7a0b99c31ad20c9d83cd00f353e622a25f80182.tar.gz
Rip out PQ_ZERO queue. PQ_ZERO functionality is now combined in with
PQ_FREE. There is little operational difference other then the kernel being a few kilobytes smaller and the code being more readable. * vm_page_select_free() has been *greatly* simplified. * The PQ_ZERO page queue and supporting structures have been removed * vm_page_zero_idle() revamped (see below) PG_ZERO setting and clearing has been migrated from vm_page_alloc() to vm_page_free[_zero]() and will eventually be guarenteed to remain tracked throughout a page's life ( if it isn't already ). When a page is freed, PG_ZERO pages are appended to the appropriate tailq in the PQ_FREE queue while non-PG_ZERO pages are prepended. When locating a new free page, PG_ZERO selection operates from within vm_page_list_find() ( get page from end of queue instead of beginning of queue ) and then only occurs in the nominal critical path case. If the nominal case misses, both normal and zero-page allocation devolves into the same _vm_page_list_find() select code without any specific zero-page optimizations. Additionally, vm_page_zero_idle() has been revamped. Hysteresis has been added and zero-page tracking adjusted to conform with the other changes. Currently hysteresis is set at 1/3 (lo) and 1/2 (hi) the number of free pages. We may wish to increase both parameters as time permits. The hysteresis is designed to avoid silly zeroing in borderline allocation/free situations.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/aim/vm_machdep.c13
-rw-r--r--sys/powerpc/powerpc/vm_machdep.c13
2 files changed, 14 insertions, 12 deletions
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c
index ed102b1..b7bef7d 100644
--- a/sys/powerpc/aim/vm_machdep.c
+++ b/sys/powerpc/aim/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.7 1998/12/30 10:38:58 dfr Exp $
+ * $Id: vm_machdep.c,v 1.8 1999/01/26 02:49:51 julian Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -469,8 +469,8 @@ vm_page_zero_idle()
if (try_mplock()) {
#endif
s = splvm();
- m = vm_page_list_find(PQ_FREE, free_rover);
- if (m != NULL) {
+ m = vm_page_list_find(PQ_FREE, free_rover, FALSE);
+ if (m != NULL && (m->flags & PG_ZERO) == 0) {
--(*vm_page_queues[m->queue].lcnt);
TAILQ_REMOVE(vm_page_queues[m->queue].pl, m, pageq);
m->queue = PQ_NONE;
@@ -483,14 +483,15 @@ vm_page_zero_idle()
get_mplock();
#endif
(void)splvm();
- m->queue = PQ_ZERO + m->pc;
+ vm_page_flag_set(m, PG_ZERO);
+ m->queue = PQ_FREE + m->pc;
++(*vm_page_queues[m->queue].lcnt);
- TAILQ_INSERT_HEAD(vm_page_queues[m->queue].pl, m,
+ TAILQ_INSERT_TAIL(vm_page_queues[m->queue].pl, m,
pageq);
- free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
++vm_page_zero_count;
++cnt_prezero;
}
+ free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
splx(s);
#ifdef SMP
rel_mplock();
diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c
index ed102b1..b7bef7d 100644
--- a/sys/powerpc/powerpc/vm_machdep.c
+++ b/sys/powerpc/powerpc/vm_machdep.c
@@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
- * $Id: vm_machdep.c,v 1.7 1998/12/30 10:38:58 dfr Exp $
+ * $Id: vm_machdep.c,v 1.8 1999/01/26 02:49:51 julian Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -469,8 +469,8 @@ vm_page_zero_idle()
if (try_mplock()) {
#endif
s = splvm();
- m = vm_page_list_find(PQ_FREE, free_rover);
- if (m != NULL) {
+ m = vm_page_list_find(PQ_FREE, free_rover, FALSE);
+ if (m != NULL && (m->flags & PG_ZERO) == 0) {
--(*vm_page_queues[m->queue].lcnt);
TAILQ_REMOVE(vm_page_queues[m->queue].pl, m, pageq);
m->queue = PQ_NONE;
@@ -483,14 +483,15 @@ vm_page_zero_idle()
get_mplock();
#endif
(void)splvm();
- m->queue = PQ_ZERO + m->pc;
+ vm_page_flag_set(m, PG_ZERO);
+ m->queue = PQ_FREE + m->pc;
++(*vm_page_queues[m->queue].lcnt);
- TAILQ_INSERT_HEAD(vm_page_queues[m->queue].pl, m,
+ TAILQ_INSERT_TAIL(vm_page_queues[m->queue].pl, m,
pageq);
- free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
++vm_page_zero_count;
++cnt_prezero;
}
+ free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
splx(s);
#ifdef SMP
rel_mplock();
OpenPOWER on IntegriCloud