Subject: Re: UBC and occasional-use apps
To: None <current-users@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: current-users
Date: 10/27/2001 00:02:56
--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hi,

I've attached an updated and simplified version of lars' patch.
we still want to enforce the minimum limits for different type of pages
even if we don't reuse non-vnode pages very quickly.

could folks please try this out and post your impressions of how effective
it is at avoiding the bad behaviour that we currently see?

-Chuck


On Fri, Oct 26, 2001 at 07:37:29AM +0100, Lars Heidieker wrote:
> Hi,
> 
> Netscape has a much smaller memory footprint so it comes back faster.
> Mozilla with its big memory footprint shows the troubles you will have with 
> big memroy systems.
>  From my point of view the problem is that the pageoutscanner does not make 
> any difference between fs-cache-only-pages and other memory. (until a 
> tuneable limit is reached) But the limit does not cope with the problem of 
> different workloads.
> I have done a small patch that changes the scanner the way that it scans a 
> few pages (32) with the lru paradigm and afterwards it scans only for 
> fs-cache-only pages (reactivating others) this makes other pages "leaving 
> the physical memory" much slower.
> 
> 
> Lars

--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.slow-nonvnode-reuse"

Index: uvm/uvm_pdaemon.c
===================================================================
RCS file: /cvsroot/syssrc/sys/uvm/uvm_pdaemon.c,v
retrieving revision 1.39
diff -u -r1.39 uvm_pdaemon.c
--- uvm/uvm_pdaemon.c	2001/09/30 02:57:34	1.39
+++ uvm/uvm_pdaemon.c	2001/10/27 07:02:47
@@ -364,7 +364,7 @@
 	struct simplelock *slock;
 	int swnpages, swcpages;
 	int swslot;
-	int dirtyreacts, t, result;
+	int dirtyreacts, t, result, nvnpages;
 	UVMHIST_FUNC("uvmpd_scan_inactive"); UVMHIST_CALLED(pdhist);
 
 	/*
@@ -376,6 +376,7 @@
 	swslot = 0;
 	swnpages = swcpages = 0;
 	dirtyreacts = 0;
+	nvnpages = (uvmexp.vnodepages > uvmexp.npages / 3) ? 32 : 1024;
 	for (p = TAILQ_FIRST(pglst); p != NULL || swslot != 0; p = nextpg) {
 		uobj = NULL;
 		anon = NULL;
@@ -451,6 +452,15 @@
 				uvm_pageactivate(p);
 				uvmexp.pdrevnode++;
 				continue;
+			}
+			if (nvnpages == 0) {
+				if (uobj == NULL || !UVM_OBJ_IS_VNODE(uobj) ||
+				    uobj->uo_refs != 0) {
+					uvm_pageactivate(p);
+					continue;
+				}
+			} else if (uobj == NULL) {
+				nvnpages--;
 			}
 
 			/*

--h31gzZEtNLTqOjlF--