1) Some of the counters in the vmmeter struct don't fit well into the Mach VM
scheme of things, so I've changed them to be more appropriate. page in/ous are now associated with the pager that did them. Nuked v_fault as the only fault of interest that wouldn't be already counted in v_trap is a VM fault, and this is counted seperately. 2) Implemented most of the remaining counters and corrected the counting of some that were done wrong. They are all almost correct now...just a few minor ones left to fix.
This commit is contained in:
parent
b8d95f1624
commit
976e77fc9c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3612
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
|
||||
* $Id: genassym.c,v 1.15 1994/10/06 09:22:44 rgrimes Exp $
|
||||
* $Id: genassym.c,v 1.16 1994/10/09 07:34:28 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -99,10 +99,6 @@ main()
|
||||
printf("#define\tV_SYSCALL %d\n", &vm->v_syscall);
|
||||
printf("#define\tV_INTR %d\n", &vm->v_intr);
|
||||
printf("#define\tV_SOFT %d\n", &vm->v_soft);
|
||||
/* printf("#define\tV_PDMA %d\n", &vm->v_pdma); */
|
||||
printf("#define\tV_FAULTS %d\n", &vm->v_faults);
|
||||
/* printf("#define\tV_PGREC %d\n", &vm->v_pgrec); */
|
||||
/* printf("#define\tV_FASTPGREC %d\n", &vm->v_fastpgrec); */
|
||||
printf("#define\tUPAGES %d\n", UPAGES);
|
||||
printf("#define\tCLSIZE %d\n", CLSIZE);
|
||||
printf("#define\tNBPG %d\n", NBPG);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)genassym.c 5.11 (Berkeley) 5/10/91
|
||||
* $Id: genassym.c,v 1.15 1994/10/06 09:22:44 rgrimes Exp $
|
||||
* $Id: genassym.c,v 1.16 1994/10/09 07:34:28 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -99,10 +99,6 @@ main()
|
||||
printf("#define\tV_SYSCALL %d\n", &vm->v_syscall);
|
||||
printf("#define\tV_INTR %d\n", &vm->v_intr);
|
||||
printf("#define\tV_SOFT %d\n", &vm->v_soft);
|
||||
/* printf("#define\tV_PDMA %d\n", &vm->v_pdma); */
|
||||
printf("#define\tV_FAULTS %d\n", &vm->v_faults);
|
||||
/* printf("#define\tV_PGREC %d\n", &vm->v_pgrec); */
|
||||
/* printf("#define\tV_FASTPGREC %d\n", &vm->v_fastpgrec); */
|
||||
printf("#define\tUPAGES %d\n", UPAGES);
|
||||
printf("#define\tCLSIZE %d\n", CLSIZE);
|
||||
printf("#define\tNBPG %d\n", NBPG);
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vmmeter.h 8.1 (Berkeley) 6/2/93
|
||||
* $Id: vmmeter.h,v 1.3 1994/08/02 07:54:12 davidg Exp $
|
||||
* $Id: vmmeter.h,v 1.4 1994/08/21 04:42:14 paul Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_VMMETER_H_
|
||||
@ -49,7 +49,6 @@ struct vmmeter {
|
||||
unsigned v_syscall; /* calls to syscall() */
|
||||
unsigned v_intr; /* device interrupts */
|
||||
unsigned v_soft; /* software interrupts */
|
||||
unsigned v_faults; /* total faults taken */
|
||||
/*
|
||||
* Virtual memory activity.
|
||||
*/
|
||||
@ -57,14 +56,14 @@ struct vmmeter {
|
||||
unsigned v_hits; /* object cache hits */
|
||||
unsigned v_vm_faults; /* number of address memory faults */
|
||||
unsigned v_cow_faults; /* number of copy-on-writes */
|
||||
unsigned v_swpin; /* swapins */
|
||||
unsigned v_swpout; /* swapouts */
|
||||
unsigned v_pswpin; /* pages swapped in */
|
||||
unsigned v_pswpout; /* pages swapped out */
|
||||
unsigned v_pageins; /* number of pageins */
|
||||
unsigned v_pageouts; /* number of pageouts */
|
||||
unsigned v_pgpgin; /* pages paged in */
|
||||
unsigned v_pgpgout; /* pages paged out */
|
||||
unsigned v_swapin; /* swap pager pageins */
|
||||
unsigned v_swapout; /* swap pager pageouts */
|
||||
unsigned v_swappgsin; /* swap pager pages paged in */
|
||||
unsigned v_swappgsout; /* swap pager pages paged out */
|
||||
unsigned v_vnodein; /* vnode pager pageins */
|
||||
unsigned v_vnodeout; /* vnode pager pageouts */
|
||||
unsigned v_vnodepgsin; /* vnode_pager pages paged in */
|
||||
unsigned v_vnodepgsout; /* vnode pager pages paged out */
|
||||
unsigned v_intrans; /* intransit blocking page faults */
|
||||
unsigned v_reactivated; /* number of pages reactivated from free list */
|
||||
unsigned v_rev; /* revolutions of the hand */
|
||||
|
@ -39,7 +39,7 @@
|
||||
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
|
||||
*
|
||||
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
|
||||
* $Id: swap_pager.c,v 1.12 1994/10/14 01:58:52 davidg Exp $
|
||||
* $Id: swap_pager.c,v 1.13 1994/10/14 12:26:17 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -1081,6 +1081,8 @@ swap_pager_input(swp, m, count, reqpage)
|
||||
|
||||
swp->sw_piip++;
|
||||
|
||||
cnt.v_swapin++;
|
||||
cnt.v_swappgsin += count;
|
||||
/*
|
||||
* perform the I/O
|
||||
*/
|
||||
@ -1457,6 +1459,9 @@ swap_pager_output(swp, m, count, flags, rtvals)
|
||||
bp->b_flags |= B_CALL;
|
||||
bp->b_iodone = swap_pager_iodone1;
|
||||
}
|
||||
|
||||
cnt.v_swapout++;
|
||||
cnt.v_swappgsout += count;
|
||||
/*
|
||||
* perform the I/O
|
||||
*/
|
||||
|
@ -66,7 +66,7 @@
|
||||
* any improvements or extensions that they make and grant Carnegie the
|
||||
* rights to redistribute these changes.
|
||||
*
|
||||
* $Id: vm_fault.c,v 1.7 1994/10/09 01:52:07 phk Exp $
|
||||
* $Id: vm_fault.c,v 1.8 1994/10/15 10:33:47 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -274,6 +274,7 @@ vm_fault(map, vaddr, fault_type, change_wiring)
|
||||
s = splhigh();
|
||||
if (m->flags & (PG_BUSY|PG_VMIO)) {
|
||||
m->flags |= PG_WANTED;
|
||||
cnt.v_intrans++;
|
||||
tsleep((caddr_t)m,PSWP,"vmpfw",0);
|
||||
}
|
||||
splx(s);
|
||||
@ -371,7 +372,6 @@ vm_fault(map, vaddr, fault_type, change_wiring)
|
||||
* the routine. The reqpage return value is the index into the
|
||||
* marray for the vm_page_t passed to the routine.
|
||||
*/
|
||||
cnt.v_pageins++;
|
||||
faultcount = vm_fault_additional_pages(
|
||||
first_object, first_offset,
|
||||
m, VM_FAULT_READ_BEHIND, VM_FAULT_READ_AHEAD,
|
||||
@ -400,7 +400,6 @@ vm_fault(map, vaddr, fault_type, change_wiring)
|
||||
*/
|
||||
m = vm_page_lookup(object, offset);
|
||||
|
||||
cnt.v_pgpgin++;
|
||||
m->flags &= ~PG_FAKE;
|
||||
pmap_clear_modify(VM_PAGE_TO_PHYS(m));
|
||||
hardfault++;
|
||||
|
@ -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.16 1994/10/09 01:52:15 phk Exp $
|
||||
* $Id: vm_pageout.c,v 1.17 1994/10/13 21:01:39 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -213,17 +213,12 @@ vm_pageout_clean(m, sync)
|
||||
pmap_page_protect(VM_PAGE_TO_PHYS(ms[i]), VM_PROT_READ);
|
||||
}
|
||||
object->paging_in_progress += pageout_count;
|
||||
cnt.v_pageouts++;
|
||||
cnt.v_pgpgout += pageout_count;
|
||||
} else {
|
||||
|
||||
m->flags |= PG_BUSY;
|
||||
|
||||
pmap_page_protect(VM_PAGE_TO_PHYS(m), VM_PROT_READ);
|
||||
|
||||
cnt.v_pageouts++;
|
||||
cnt.v_pgpgout++;
|
||||
|
||||
object->paging_in_progress++;
|
||||
|
||||
pager = vm_pager_allocate(PG_DFLT, (caddr_t)0,
|
||||
|
@ -37,7 +37,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
|
||||
* $Id: vnode_pager.c,v 1.12 1994/10/14 08:57:25 jkh Exp $
|
||||
* $Id: vnode_pager.c,v 1.13 1994/10/14 12:26:18 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -809,6 +809,8 @@ vnode_pager_input(vnp, m, count, reqpage)
|
||||
vnode_pager_freepage(m[i]);
|
||||
}
|
||||
}
|
||||
cnt.v_vnodein++;
|
||||
cnt.v_vnodepgsin++;
|
||||
return vnode_pager_input_old(vnp, m[reqpage]);
|
||||
|
||||
/*
|
||||
@ -824,6 +826,8 @@ vnode_pager_input(vnp, m, count, reqpage)
|
||||
vnode_pager_freepage(m[i]);
|
||||
}
|
||||
}
|
||||
cnt.v_vnodein++;
|
||||
cnt.v_vnodepgsin++;
|
||||
return vnode_pager_input_smlfs(vnp, m[reqpage]);
|
||||
}
|
||||
/*
|
||||
@ -1051,8 +1055,12 @@ vnode_pager_input(vnp, m, count, reqpage)
|
||||
bp->b_bcount = size;
|
||||
bp->b_bufsize = size;
|
||||
|
||||
cnt.v_vnodein++;
|
||||
cnt.v_vnodepgsin += count;
|
||||
|
||||
/* do the input */
|
||||
VOP_STRATEGY(bp);
|
||||
|
||||
if( counta) {
|
||||
for(i=0;i<counta;i++) {
|
||||
vm_page_deactivate(m[count+i]);
|
||||
@ -1074,6 +1082,7 @@ vnode_pager_input(vnp, m, count, reqpage)
|
||||
bpa->b_bcount = sizea;
|
||||
bpa->b_bufsize = counta*PAGE_SIZE;
|
||||
|
||||
cnt.v_vnodepgsin += counta;
|
||||
VOP_STRATEGY(bpa);
|
||||
}
|
||||
|
||||
@ -1322,6 +1331,8 @@ vnode_pager_output(vnp, m, count, rtvals)
|
||||
pmap_clear_modify(VM_PAGE_TO_PHYS(m[0]));
|
||||
m[0]->flags |= PG_CLEAN;
|
||||
m[0]->flags &= ~PG_LAUNDRY;
|
||||
cnt.v_vnodeout++;
|
||||
cnt.v_vnodepgsout++;
|
||||
return rtvals[0];
|
||||
}
|
||||
|
||||
@ -1340,6 +1351,8 @@ vnode_pager_output(vnp, m, count, rtvals)
|
||||
m[i]->flags &= ~PG_LAUNDRY;
|
||||
}
|
||||
}
|
||||
cnt.v_vnodeout++;
|
||||
cnt.v_vnodepgsout += count;
|
||||
return rtvals[0];
|
||||
}
|
||||
|
||||
@ -1450,6 +1463,9 @@ vnode_pager_output(vnp, m, count, rtvals)
|
||||
bp->b_bcount = size;
|
||||
bp->b_bufsize = size;
|
||||
|
||||
cnt.v_vnodeout++;
|
||||
cnt.v_vnodepgsout += count;
|
||||
|
||||
/* do the output */
|
||||
VOP_STRATEGY(bp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user