summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_pageout.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-08-30 18:27:44 +0000
committerdg <dg@FreeBSD.org>1994-08-30 18:27:44 +0000
commit16e35aa36891f87e30ac7b1d2bc53d00f7d5b563 (patch)
treee28d5c172eac5e06a132856b446f2cddbecee6a2 /sys/vm/vm_pageout.c
parent33e88fdce99396771f6d5750e4a1128a333abc9e (diff)
downloadFreeBSD-src-16e35aa36891f87e30ac7b1d2bc53d00f7d5b563.zip
FreeBSD-src-16e35aa36891f87e30ac7b1d2bc53d00f7d5b563.tar.gz
Fixed bug caused by change of rlimit variables to quad_t's. The bug was in
using min() to calculate the minimum of rss_cur,rss_max - since these are now quad_t's and min() takes u_ints...the comparison later for exceeding the rss limit was always true - resulting in rather serious page thrashing. Now using new qmin() function for this purpose. Fixed another bug where PG_BUSY pages would sometimes be paged out (bad!). This was caused by the PG_BUSY flag not being included in a comparison.
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r--sys/vm/vm_pageout.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index b56d719..76af5f0 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -65,7 +65,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pageout.c,v 1.7 1994/08/06 09:15:39 davidg Exp $
+ * $Id: vm_pageout.c,v 1.8 1994/08/18 22:36:07 wollman Exp $
*/
/*
@@ -103,7 +103,7 @@ extern int swap_pager_ready();
/* set the "clock" hands to be (MAXSCAN * 4096) Bytes */
#define ACT_DECLINE 1
#define ACT_ADVANCE 3
-#define ACT_MAX 300
+#define ACT_MAX 100
#define LOWATER ((2048*1024)/NBPG)
@@ -190,11 +190,11 @@ vm_pageout_clean(m, sync)
pageout_count = 1;
ms[0] = m;
- if( pager = object->pager) {
- for(i=1;i<vm_pageout_page_count;i++) {
- if( ms[i] = vm_page_lookup( object, offset+i*NBPG)) {
- if((((ms[i]->flags & (PG_CLEAN|PG_INACTIVE|PG_BUSY)) == PG_INACTIVE)
- || (( ms[i]->flags & PG_CLEAN) == 0 && sync == VM_PAGEOUT_FORCE))
+ if (pager = object->pager) {
+ for (i = 1; i < vm_pageout_page_count; i++) {
+ if (ms[i] = vm_page_lookup(object, offset+i*NBPG)) {
+ if (( ((ms[i]->flags & (PG_CLEAN|PG_INACTIVE|PG_BUSY)) == PG_INACTIVE)
+ || ( (ms[i]->flags & PG_CLEAN|PG_BUSY) == 0 && sync == VM_PAGEOUT_FORCE))
&& (ms[i]->wire_count == 0)
&& (ms[i]->hold_count == 0))
pageout_count++;
@@ -491,7 +491,7 @@ rescanproc1:
for (p = (struct proc *)allproc; p != NULL; p = p->p_next) {
vm_offset_t size;
int overage;
- vm_offset_t limit;
+ quad_t limit;
/*
* if this is a system process or if we have already
@@ -512,7 +512,7 @@ rescanproc1:
/*
* get a limit
*/
- limit = min(p->p_rlimit[RLIMIT_RSS].rlim_cur,
+ limit = qmin(p->p_rlimit[RLIMIT_RSS].rlim_cur,
p->p_rlimit[RLIMIT_RSS].rlim_max);
/*
@@ -523,12 +523,11 @@ rescanproc1:
limit = 0;
size = p->p_vmspace->vm_pmap.pm_stats.resident_count * NBPG;
- if (size >= limit) {
+ if (limit > 0 && size >= limit) {
overage = (size - limit) / NBPG;
vm_pageout_map_deactivate_pages(&p->p_vmspace->vm_map,
(vm_map_entry_t) 0, &overage, vm_pageout_object_deactivate_pages);
}
-
}
if (((cnt.v_free_count + cnt.v_inactive_count) >=
OpenPOWER on IntegriCloud