summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-09-12 15:06:14 +0000
committerdg <dg@FreeBSD.org>1994-09-12 15:06:14 +0000
commit71d8424950db60a9f1f66a5c7015cfcb49c201df (patch)
tree1741f08236fa4c403c4c1cfa1e8c3a9d46b1ea0f /sys/vm/vm_glue.c
parentd00638ae6a81910056cad306f79ddf7dd93fbd22 (diff)
downloadFreeBSD-src-71d8424950db60a9f1f66a5c7015cfcb49c201df.zip
FreeBSD-src-71d8424950db60a9f1f66a5c7015cfcb49c201df.tar.gz
Fixed a bug I introduced when fixing the rss limit code. Changed swapout
policy to be a bit more selective about what processes get swapped out. Reviewed by: John Dyson
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 2fc7aba..668b7f9 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -59,7 +59,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_glue.c,v 1.5 1994/08/09 10:42:41 davidg Exp $
+ * $Id: vm_glue.c,v 1.6 1994/08/18 22:36:01 wollman Exp $
*/
#include <sys/param.h>
@@ -518,7 +518,11 @@ swapmore:
continue;
}
vm_map_unlock( &p->p_vmspace->vm_map);
- if (p->p_slptime > maxslp) {
+ /*
+ * If the process has been asleep for awhile and had most
+ * of its pages taken away already, swap it out.
+ */
+ if ((p->p_slptime > maxslp) && (p->p_vmspace->vm_pmap.pm_stats.resident_count <= 6)) {
swapout(p);
didswap++;
} else if ((tpri = p->p_slptime + p->p_nice * 8) > outpri) {
@@ -539,7 +543,11 @@ swapmore:
p = outp2;
}
- if (p) {
+ /*
+ * Only swapout processes that have already had most
+ * of their pages taken away.
+ */
+ if (p && (p->p_vmspace->vm_pmap.pm_stats.resident_count <= 6)) {
swapout(p);
didswap = 1;
}
OpenPOWER on IntegriCloud