diff options
author | silby <silby@FreeBSD.org> | 2003-12-27 07:52:47 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-12-27 07:52:47 +0000 |
commit | 5c5418dd6e3fd1a458707433f5509baf8876a0ef (patch) | |
tree | 98b609cd809b91f8fe99dba49d5591243871a9a2 /sys/powerpc | |
parent | b82aa9e5c7a65948641e2fec0986f7b05a84b3a4 (diff) | |
download | FreeBSD-src-5c5418dd6e3fd1a458707433f5509baf8876a0ef.zip FreeBSD-src-5c5418dd6e3fd1a458707433f5509baf8876a0ef.tar.gz |
Track current and peak sfbuf usage, export the values via sysctl.
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/aim/vm_machdep.c | 4 | ||||
-rw-r--r-- | sys/powerpc/powerpc/vm_machdep.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index 5293ed3..a68b4ea 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -116,6 +116,7 @@ static struct { } sf_freelist; static u_int sf_buf_alloc_want; +extern int nsfbufspeak, nsfbufsused; /* * Finish a fork operation, with process p2 nearly set up. @@ -282,6 +283,8 @@ sf_buf_alloc(struct vm_page *m) if (sf != NULL) { SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list); sf->m = m; + nsfbufsused++; + nsfbufspeak = max(nsfbufspeak, nsfbufsused); pmap_qenter(sf->kva, &sf->m, 1); } mtx_unlock(&sf_freelist.sf_lock); @@ -313,6 +316,7 @@ sf_buf_free(void *addr, void *args) sf->m = NULL; mtx_lock(&sf_freelist.sf_lock); SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); + nsfbufsused--; if (sf_buf_alloc_want > 0) wakeup_one(&sf_freelist); mtx_unlock(&sf_freelist.sf_lock); diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index 5293ed3..a68b4ea 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -116,6 +116,7 @@ static struct { } sf_freelist; static u_int sf_buf_alloc_want; +extern int nsfbufspeak, nsfbufsused; /* * Finish a fork operation, with process p2 nearly set up. @@ -282,6 +283,8 @@ sf_buf_alloc(struct vm_page *m) if (sf != NULL) { SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list); sf->m = m; + nsfbufsused++; + nsfbufspeak = max(nsfbufspeak, nsfbufsused); pmap_qenter(sf->kva, &sf->m, 1); } mtx_unlock(&sf_freelist.sf_lock); @@ -313,6 +316,7 @@ sf_buf_free(void *addr, void *args) sf->m = NULL; mtx_lock(&sf_freelist.sf_lock); SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); + nsfbufsused--; if (sf_buf_alloc_want > 0) wakeup_one(&sf_freelist); mtx_unlock(&sf_freelist.sf_lock); |