summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-02-19 23:22:42 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-02-19 23:22:42 +0000
commitba16f5544e410bd59f067f95d96e9a425e1fd3cc (patch)
tree9be3b512fbc3cb4b3e67d321a4467bf2b7654025
parent960849b55a261287d23f39db4c72eec6ca018575 (diff)
Make swap accounting actually work...
-rw-r--r--sys/vm/swap_pager.c8
-rw-r--r--sys/vm/vm_glue.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index d69c7f039b3..b1f8b0d7700 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -780,6 +780,14 @@ swap_pager_io(swp, mlist, npages, flags)
bp, swb->swb_block+btodb(off), kva, VM_PAGE_TO_PHYS(m));
#endif
VOP_STRATEGY(bp);
+ if (flags & B_READ) {
+ cnt.v_swpin++;
+ cnt.v_pswpin += npages;
+ }
+ else {
+ cnt.v_swpout++;
+ cnt.v_pswpout += npages;
+ }
if ((flags & (B_READ|B_ASYNC)) == B_ASYNC) {
#ifdef DEBUG
if (swpagerdebug & SDB_IO)
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 5fd2d006a55..df95fb03fb2 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -357,8 +357,6 @@ swapin(p)
p->p_flag |= P_INMEM;
splx(s);
p->p_swtime = 0;
- cnt.v_swpin++;
- cnt.v_pswpin += USPACE * CLSIZE / NBPG;
}
/*
@@ -547,8 +545,6 @@ swapout(p)
remrq(p);
splx(s);
p->p_swtime = 0;
- cnt.v_swpin++;
- cnt.v_pswpin += USPACE * CLSIZE / NBPG;
}
/*