summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-03-22 04:28:16 +0000
committerdyson <dyson@FreeBSD.org>1997-03-22 04:28:16 +0000
commitbd6347d78d8bc0690951bb37df7601bc1b705753 (patch)
tree1f18e1ab3fbac9b78737d1db88d23b6f2e10e2c0
parent3860b8cd127797c2d283a53fb1310460d1efcc85 (diff)
downloadFreeBSD-src-bd6347d78d8bc0690951bb37df7601bc1b705753.zip
FreeBSD-src-bd6347d78d8bc0690951bb37df7601bc1b705753.tar.gz
Decrease the latency/overhead in the prezero code when there is
an adequate number of prezeroed pages.
-rw-r--r--sys/amd64/amd64/vm_machdep.c19
-rw-r--r--sys/i386/i386/vm_machdep.c19
2 files changed, 34 insertions, 4 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 18fda31..376af2a 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/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$
+ * $Id: vm_machdep.c,v 1.75 1997/02/22 09:33:01 peter Exp $
*/
#include "npx.h"
@@ -854,7 +854,22 @@ int
vm_page_zero_idle() {
vm_page_t m;
static int free_rover = 0;
- if ((cnt.v_free_count > cnt.v_interrupt_free_min) &&
+/* XXX
+ * We stop zeroing pages when there are sufficent prezeroed pages.
+ * This threshold isn't really needed, except we want to
+ * bypass unneeded calls to vm_page_list_find, and the
+ * associated cache flush and latency. The pre-zero will
+ * still be called when there are significantly more
+ * non-prezeroed pages than zeroed pages. The threshold
+ * of half the number of reserved pages is arbitrary, but
+ * approximately the right amount. Eventually, we should
+ * perhaps interrupt the zero operation when a process
+ * is found to be ready to run.
+ */
+ if (((cnt.v_free_count - vm_page_zero_count) > (cnt.v_free_reserved / 2)) &&
+#ifdef NOT_NEEDED
+ (cnt.v_free_count > cnt.v_interrupt_free_min) &&
+#endif
(m = vm_page_list_find(PQ_FREE, free_rover))) {
--(*vm_page_queues[m->queue].lcnt);
TAILQ_REMOVE(vm_page_queues[m->queue].pl, m, pageq);
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index 18fda31..376af2a 100644
--- a/sys/i386/i386/vm_machdep.c
+++ b/sys/i386/i386/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$
+ * $Id: vm_machdep.c,v 1.75 1997/02/22 09:33:01 peter Exp $
*/
#include "npx.h"
@@ -854,7 +854,22 @@ int
vm_page_zero_idle() {
vm_page_t m;
static int free_rover = 0;
- if ((cnt.v_free_count > cnt.v_interrupt_free_min) &&
+/* XXX
+ * We stop zeroing pages when there are sufficent prezeroed pages.
+ * This threshold isn't really needed, except we want to
+ * bypass unneeded calls to vm_page_list_find, and the
+ * associated cache flush and latency. The pre-zero will
+ * still be called when there are significantly more
+ * non-prezeroed pages than zeroed pages. The threshold
+ * of half the number of reserved pages is arbitrary, but
+ * approximately the right amount. Eventually, we should
+ * perhaps interrupt the zero operation when a process
+ * is found to be ready to run.
+ */
+ if (((cnt.v_free_count - vm_page_zero_count) > (cnt.v_free_reserved / 2)) &&
+#ifdef NOT_NEEDED
+ (cnt.v_free_count > cnt.v_interrupt_free_min) &&
+#endif
(m = vm_page_list_find(PQ_FREE, free_rover))) {
--(*vm_page_queues[m->queue].lcnt);
TAILQ_REMOVE(vm_page_queues[m->queue].pl, m, pageq);
OpenPOWER on IntegriCloud