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/amd64 | |
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/amd64')
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index fad5c4e..ef19790 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -99,6 +99,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. @@ -473,6 +474,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); } mtx_unlock(&sf_freelist.sf_lock); return (sf); @@ -502,6 +505,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); |