aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1999-02-08 02:42:13 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1999-02-08 02:42:13 +0000
commitdd2f9956e20ec47c98f5ba8822f2fe4eeb590bf3 (patch)
treef2e8198f4669b4b0f9251f178e65135e9ec15843 /sys
parent2d7142ca1a0cbd5ed692a361385be2733670fffb (diff)
downloadsrc-dd2f9956e20ec47c98f5ba8822f2fe4eeb590bf3.tar.gz
src-dd2f9956e20ec47c98f5ba8822f2fe4eeb590bf3.zip
Adjust idle zero-page fill hysteresis based on tests. Use 2/3 and 4/5
zero-fill levels. Adjust comment for ozfod in vmmeter.h - this counter represents non-optimal ( on the fly ) zero fills, not prefills.
Notes
Notes: svn path=/head/; revision=43758
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/vm_machdep.c12
-rw-r--r--sys/amd64/amd64/vm_machdep.c12
-rw-r--r--sys/i386/i386/vm_machdep.c12
-rw-r--r--sys/powerpc/aim/vm_machdep.c12
-rw-r--r--sys/powerpc/powerpc/vm_machdep.c12
-rw-r--r--sys/sys/vmmeter.h4
6 files changed, 42 insertions, 22 deletions
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c
index 9881c5fa1c11..658f730197d4 100644
--- a/sys/alpha/alpha/vm_machdep.c
+++ b/sys/alpha/alpha/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.9 1999/02/08 00:37:35 dillon Exp $
+ * $Id: vm_machdep.c,v 1.10 1999/02/08 00:47:32 dillon Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -443,6 +443,10 @@ SYSCTL_INT(_machdep, OID_AUTO, cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
* Implement the pre-zeroed page mechanism.
* This routine is called from the idle loop.
*/
+
+#define ZIDLE_LO(v) ((v) * 2 / 3)
+#define ZIDLE_HI(v) ((v) * 4 / 5)
+
int
vm_page_zero_idle()
{
@@ -460,9 +464,9 @@ vm_page_zero_idle()
* pages because doing so may flush our L1 and L2 caches too much.
*/
- if (zero_state && vm_page_zero_count >= cnt.v_free_count / 3)
+ if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count))
return(0);
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
return(0);
#ifdef SMP
@@ -491,7 +495,7 @@ vm_page_zero_idle()
pageq);
++vm_page_zero_count;
++cnt_prezero;
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
zero_state = 1;
}
free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 2e9e6aa91674..5ea99bfae629 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: vm_machdep.c,v 1.116 1999/01/29 08:36:42 dillon Exp $
+ * $Id: vm_machdep.c,v 1.117 1999/02/08 00:37:35 dillon Exp $
*/
#include "npx.h"
@@ -586,6 +586,10 @@ SYSCTL_INT(_vm_stats_misc, OID_AUTO,
* Implement the pre-zeroed page mechanism.
* This routine is called from the idle loop.
*/
+
+#define ZIDLE_LO(v) ((v) * 2 / 3)
+#define ZIDLE_HI(v) ((v) * 4 / 5)
+
int
vm_page_zero_idle()
{
@@ -603,9 +607,9 @@ vm_page_zero_idle()
* pages because doing so may flush our L1 and L2 caches too much.
*/
- if (zero_state && vm_page_zero_count >= cnt.v_free_count / 3)
+ if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count))
return(0);
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
return(0);
#ifdef SMP
@@ -635,7 +639,7 @@ vm_page_zero_idle()
pageq);
++vm_page_zero_count;
++cnt_prezero;
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
zero_state = 1;
}
free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c
index 2e9e6aa91674..5ea99bfae629 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: vm_machdep.c,v 1.116 1999/01/29 08:36:42 dillon Exp $
+ * $Id: vm_machdep.c,v 1.117 1999/02/08 00:37:35 dillon Exp $
*/
#include "npx.h"
@@ -586,6 +586,10 @@ SYSCTL_INT(_vm_stats_misc, OID_AUTO,
* Implement the pre-zeroed page mechanism.
* This routine is called from the idle loop.
*/
+
+#define ZIDLE_LO(v) ((v) * 2 / 3)
+#define ZIDLE_HI(v) ((v) * 4 / 5)
+
int
vm_page_zero_idle()
{
@@ -603,9 +607,9 @@ vm_page_zero_idle()
* pages because doing so may flush our L1 and L2 caches too much.
*/
- if (zero_state && vm_page_zero_count >= cnt.v_free_count / 3)
+ if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count))
return(0);
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
return(0);
#ifdef SMP
@@ -635,7 +639,7 @@ vm_page_zero_idle()
pageq);
++vm_page_zero_count;
++cnt_prezero;
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
zero_state = 1;
}
free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c
index 9881c5fa1c11..658f730197d4 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.9 1999/02/08 00:37:35 dillon Exp $
+ * $Id: vm_machdep.c,v 1.10 1999/02/08 00:47:32 dillon Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -443,6 +443,10 @@ SYSCTL_INT(_machdep, OID_AUTO, cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
* Implement the pre-zeroed page mechanism.
* This routine is called from the idle loop.
*/
+
+#define ZIDLE_LO(v) ((v) * 2 / 3)
+#define ZIDLE_HI(v) ((v) * 4 / 5)
+
int
vm_page_zero_idle()
{
@@ -460,9 +464,9 @@ vm_page_zero_idle()
* pages because doing so may flush our L1 and L2 caches too much.
*/
- if (zero_state && vm_page_zero_count >= cnt.v_free_count / 3)
+ if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count))
return(0);
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
return(0);
#ifdef SMP
@@ -491,7 +495,7 @@ vm_page_zero_idle()
pageq);
++vm_page_zero_count;
++cnt_prezero;
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
zero_state = 1;
}
free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c
index 9881c5fa1c11..658f730197d4 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.9 1999/02/08 00:37:35 dillon Exp $
+ * $Id: vm_machdep.c,v 1.10 1999/02/08 00:47:32 dillon Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -443,6 +443,10 @@ SYSCTL_INT(_machdep, OID_AUTO, cnt_prezero, CTLFLAG_RD, &cnt_prezero, 0, "");
* Implement the pre-zeroed page mechanism.
* This routine is called from the idle loop.
*/
+
+#define ZIDLE_LO(v) ((v) * 2 / 3)
+#define ZIDLE_HI(v) ((v) * 4 / 5)
+
int
vm_page_zero_idle()
{
@@ -460,9 +464,9 @@ vm_page_zero_idle()
* pages because doing so may flush our L1 and L2 caches too much.
*/
- if (zero_state && vm_page_zero_count >= cnt.v_free_count / 3)
+ if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count))
return(0);
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
return(0);
#ifdef SMP
@@ -491,7 +495,7 @@ vm_page_zero_idle()
pageq);
++vm_page_zero_count;
++cnt_prezero;
- if (vm_page_zero_count >= cnt.v_free_count / 2)
+ if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
zero_state = 1;
}
free_rover = (free_rover + PQ_PRIME3) & PQ_L2_MASK;
diff --git a/sys/sys/vmmeter.h b/sys/sys/vmmeter.h
index d26fafa481dd..acd8c71231ea 100644
--- a/sys/sys/vmmeter.h
+++ b/sys/sys/vmmeter.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vmmeter.h 8.2 (Berkeley) 7/10/94
- * $Id: vmmeter.h,v 1.15 1997/02/22 09:46:27 peter Exp $
+ * $Id: vmmeter.h,v 1.16 1998/03/07 20:45:39 dyson Exp $
*/
#ifndef _SYS_VMMETER_H_
@@ -56,7 +56,7 @@ struct vmmeter {
u_int v_cow_faults; /* number of copy-on-writes */
u_int v_cow_optim; /* number of optimized copy-on-writes */
u_int v_zfod; /* pages zero filled on demand */
- u_int v_ozfod; /* pages prezero filled on demand */
+ u_int v_ozfod; /* non-optimal zero filled on demand */
u_int v_swapin; /* swap pager pageins */
u_int v_swapout; /* swap pager pageouts */
u_int v_swappgsin; /* swap pager pages paged in */