summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/ps/print.c1
-rw-r--r--sys/amd64/include/vmparam.h11
-rw-r--r--sys/arm/include/vmparam.h1
-rw-r--r--sys/i386/include/vmparam.h12
-rw-r--r--sys/ia64/include/vmparam.h11
-rw-r--r--sys/mips/include/vmparam.h11
-rw-r--r--sys/powerpc/include/vmparam.h11
-rw-r--r--sys/sparc64/include/vmparam.h11
-rw-r--r--sys/sun4v/include/vmparam.h11
-rw-r--r--sys/sys/vmmeter.h6
-rw-r--r--sys/vm/vm_glue.c16
-rw-r--r--sys/vm/vm_meter.c2
12 files changed, 14 insertions, 90 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index cc33cdd..5aa27c0 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mac.h>
#include <sys/user.h>
#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
#include <err.h>
#include <grp.h>
diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h
index 88d68b9..38a6214 100644
--- a/sys/amd64/include/vmparam.h
+++ b/sys/amd64/include/vmparam.h
@@ -70,17 +70,6 @@
#endif
/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
-/*
* We provide a machine specific single page allocator through the use
* of the direct mapped segment. This uses 2MB pages for reduced
* TLB pressure.
diff --git a/sys/arm/include/vmparam.h b/sys/arm/include/vmparam.h
index 23b0f86..c608daa 100644
--- a/sys/arm/include/vmparam.h
+++ b/sys/arm/include/vmparam.h
@@ -146,7 +146,6 @@
#define DFLSSIZ (2*1024*1024)
#define MAXSSIZ (8*1024*1024)
#define SGROWSIZ (128*1024)
-#define MAXSLP 20
#ifdef ARM_USE_SMALL_ALLOC
#define UMA_MD_SMALL_ALLOC
diff --git a/sys/i386/include/vmparam.h b/sys/i386/include/vmparam.h
index 2b159b6..e944810 100644
--- a/sys/i386/include/vmparam.h
+++ b/sys/i386/include/vmparam.h
@@ -64,18 +64,6 @@
#endif
/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
-
-/*
* The physical address space is densely populated.
*/
#define VM_PHYSSEG_DENSE
diff --git a/sys/ia64/include/vmparam.h b/sys/ia64/include/vmparam.h
index a827e01..edf5710 100644
--- a/sys/ia64/include/vmparam.h
+++ b/sys/ia64/include/vmparam.h
@@ -70,17 +70,6 @@
#endif
/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
-/*
* We need region 7 virtual addresses for pagetables.
*/
#define UMA_MD_SMALL_ALLOC
diff --git a/sys/mips/include/vmparam.h b/sys/mips/include/vmparam.h
index 212a0c3..ef01601 100644
--- a/sys/mips/include/vmparam.h
+++ b/sys/mips/include/vmparam.h
@@ -69,17 +69,6 @@
#define SGROWSIZ (128UL*1024) /* amount to grow stack */
#endif
-/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
/*
* Mach derived constants
*/
diff --git a/sys/powerpc/include/vmparam.h b/sys/powerpc/include/vmparam.h
index d98aea5..b92ce70 100644
--- a/sys/powerpc/include/vmparam.h
+++ b/sys/powerpc/include/vmparam.h
@@ -58,17 +58,6 @@
#endif
/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
-/*
* Would like to have MAX addresses = 0, but this doesn't (currently) work
*/
#if !defined(LOCORE)
diff --git a/sys/sparc64/include/vmparam.h b/sys/sparc64/include/vmparam.h
index 26caab3..fc581b3 100644
--- a/sys/sparc64/include/vmparam.h
+++ b/sys/sparc64/include/vmparam.h
@@ -66,17 +66,6 @@
#endif
/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
-/*
* The physical address space is sparsely populated.
*/
#define VM_PHYSSEG_SPARSE
diff --git a/sys/sun4v/include/vmparam.h b/sys/sun4v/include/vmparam.h
index f4b24b5..ce01651 100644
--- a/sys/sun4v/include/vmparam.h
+++ b/sys/sun4v/include/vmparam.h
@@ -66,17 +66,6 @@
#endif
/*
- * The time for a process to be blocked before being very swappable.
- * This is a number of seconds which the system takes as being a non-trivial
- * amount of real time. You probably shouldn't change this;
- * it is used in subtle ways (fractions and multiples of it are, that is, like
- * half of a ``long time'', almost a long time, etc.)
- * It is related to human patience and other factors which don't really
- * change over time.
- */
-#define MAXSLP 20
-
-/*
* The physical address space is densely populated.
*/
#define VM_PHYSSEG_DENSE
diff --git a/sys/sys/vmmeter.h b/sys/sys/vmmeter.h
index 9d74611..99531a6 100644
--- a/sys/sys/vmmeter.h
+++ b/sys/sys/vmmeter.h
@@ -34,6 +34,12 @@
#define _SYS_VMMETER_H_
/*
+ * This value is used by ps(1) to change sleep state flag from 'S' to
+ * 'I' and by the sched process to set the alarm clock.
+ */
+#define MAXSLP 20
+
+/*
* System wide statistics counters.
* Locking:
* a - locked by atomic operations
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 0b9d92a..69576d5 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -94,8 +94,6 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_pager.h>
#include <vm/swap_pager.h>
-extern int maxslp;
-
/*
* System initialization
*
@@ -770,7 +768,7 @@ loop:
* Nothing to do, back to sleep.
*/
if ((p = pp) == NULL) {
- tsleep(&proc0, PVM, "sched", maxslp * hz / 2);
+ tsleep(&proc0, PVM, "sched", MAXSLP * hz / 2);
goto loop;
}
PROC_LOCK(p);
@@ -819,12 +817,12 @@ SYSCTL_INT(_vm, OID_AUTO, swap_idle_threshold2, CTLFLAG_RW,
&swap_idle_threshold2, 0, "Time before a process will be swapped out");
/*
- * Swapout is driven by the pageout daemon. Very simple, we find eligible
- * procs and swap out their stacks. We try to always "swap" at least one
- * process in case we need the room for a swapin.
- * If any procs have been sleeping/stopped for at least maxslp seconds,
- * they are swapped. Else, we swap the longest-sleeping or stopped process,
- * if any, otherwise the longest-resident process.
+ * First, if any processes have been sleeping or stopped for at least
+ * "swap_idle_threshold1" seconds, they are swapped out. If, however,
+ * no such processes exist, then the longest-sleeping or stopped
+ * process is swapped out. Finally, and only as a last resort, if
+ * there are no sleeping or stopped processes, the longest-resident
+ * process is swapped out.
*/
void
swapout_procs(action)
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index 269de51..fb098ea 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$");
struct vmmeter cnt;
-int maxslp = MAXSLP;
-
SYSCTL_UINT(_vm, VM_V_FREE_MIN, v_free_min,
CTLFLAG_RW, &cnt.v_free_min, 0, "");
SYSCTL_UINT(_vm, VM_V_FREE_TARGET, v_free_target,
OpenPOWER on IntegriCloud