From dd0bd066e04231151e6b95b7c2cef7ae742baf48 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Sun, 18 Dec 1994 06:31:31 +0000 Subject: [PATCH] Change swapping policy to be a bit more aggressive about finding a candidate for swapout. Increased default RSS limit to a minimum of 2MB. --- sys/vm/vm_glue.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index d35ec701132c..dd8eeaaf6bda 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.8 1994/10/09 01:52:08 phk Exp $ + * $Id: vm_glue.c,v 1.9 1994/11/13 12:47:07 davidg Exp $ */ #include @@ -288,8 +288,8 @@ vm_init_limits(p) p->p_rlimit[RLIMIT_STACK].rlim_max = MAXSSIZ; p->p_rlimit[RLIMIT_DATA].rlim_cur = DFLDSIZ; p->p_rlimit[RLIMIT_DATA].rlim_max = MAXDSIZ; - /* limit the limit to no less than 128K */ - rss_limit = max(cnt.v_free_count / 2, 32); + /* limit the limit to no less than 2MB */ + rss_limit = max(cnt.v_free_count / 2, 512); p->p_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit); p->p_rlimit[RLIMIT_RSS].rlim_max = RLIM_INFINITY; } @@ -522,10 +522,11 @@ swapout_threads() * 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)) { + if (p->p_slptime > maxslp) { swapout(p); didswap++; - } else if ((tpri = p->p_slptime + p->p_nice * 8) > outpri) { + } else if ((tpri = p->p_slptime + p->p_nice * 8) > outpri && + (p->p_vmspace->vm_pmap.pm_stats.resident_count <= 6)) { outp = p; outpri = tpri ; }