diff options
author | 1996-02-19 23:22:39 +0000 | |
---|---|---|
committer | 1996-02-19 23:22:39 +0000 | |
commit | b57dbcd0b962007699af441ade2f56191caf5262 (patch) | |
tree | ef88e2e628531b1881de99e9ebf7df6e6b08e575 | |
parent | Count number of forks, vforks, rforks; still need to count VM pages affected (diff) | |
download | wireguard-openbsd-b57dbcd0b962007699af441ade2f56191caf5262.tar.xz wireguard-openbsd-b57dbcd0b962007699af441ade2f56191caf5262.zip |
Make swap accounting actually work...
-rw-r--r-- | sys/vm/swap_pager.c | 8 | ||||
-rw-r--r-- | sys/vm/vm_glue.c | 4 |
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; } /* |