Subject: Re: Strange VM behaviour
To: None <thorpej@zembu.com>
From: Lennart Augustsson <lennart@mail.augustsson.net>
List: tech-kern
Date: 02/20/2001 01:22:18
This is a multi-part message in MIME format.
--------------03EB703D1F215B9BB3541D8F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lennart Augustsson wrote:
> I did a little more than that. I put in some calls to microtime() in amap_wipeout()
> and I also counted the number of calls to uvm_swap_free() which does one
> call to extent_free(). With the test program below the time to do an amap_wipeout()
And here's the diff for getting the time from uvm.
-- Lennart
--------------03EB703D1F215B9BB3541D8F
Content-Type: text/plain; charset=us-ascii;
name="uvm.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="uvm.diff"
Index: uvm_amap.c
===================================================================
RCS file: /cvsroot/syssrc/sys/uvm/uvm_amap.c,v
retrieving revision 1.30
diff -c -r1.30 uvm_amap.c
*** uvm_amap.c 2001/02/18 21:19:09 1.30
--- uvm_amap.c 2001/02/20 06:20:02
***************
*** 499,504 ****
--- 499,508 ----
amap_wipeout(amap)
struct vm_amap *amap;
{
+ struct timeval start, end;
+ int nusf, usecs;
+ extern int N_uvm_swap_free;
+
int lcv, slot;
struct vm_anon *anon;
UVMHIST_FUNC("amap_wipeout"); UVMHIST_CALLED(maphist);
***************
*** 506,511 ****
--- 510,518 ----
LOCK_ASSERT(simple_lock_held(&amap->am_l));
+ microtime(&start);
+ nusf = N_uvm_swap_free;
+
for (lcv = 0 ; lcv < amap->am_nused ; lcv++) {
int refs;
***************
*** 528,533 ****
--- 535,547 ----
*/
uvm_anfree(anon);
}
+ }
+
+ microtime(&end);
+ nusf = N_uvm_swap_free - nusf;
+ usecs = (end.tv_sec-start.tv_sec)*1000000 + end.tv_usec-start.tv_usec;
+ if (usecs > 1000000) {
+ printf("amap_wipeout: %d usec, %d calls\n", usecs, nusf);
}
/*
Index: uvm_swap.c
===================================================================
RCS file: /cvsroot/syssrc/sys/uvm/uvm_swap.c,v
retrieving revision 1.46
diff -c -r1.46 uvm_swap.c
*** uvm_swap.c 2001/02/18 21:19:08 1.46
--- uvm_swap.c 2001/02/20 06:20:05
***************
*** 1538,1543 ****
--- 1538,1545 ----
simple_unlock(&uvm.swap_data_lock);
}
+ int N_uvm_swap_free = 0;
+
/*
* uvm_swap_free: free swap slots
*
***************
*** 1554,1559 ****
--- 1556,1563 ----
UVMHIST_LOG(pdhist, "freeing %d slots starting at %d", nslots,
startslot, 0, 0);
+
+ N_uvm_swap_free++;
/*
* ignore attempts to free the "bad" slot.
--------------03EB703D1F215B9BB3541D8F--