diff options
author | dyson <dyson@FreeBSD.org> | 1997-08-07 03:52:55 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1997-08-07 03:52:55 +0000 |
commit | 85f902e519afa7dd7e3c1b375e69d01c672307e4 (patch) | |
tree | e30bb51cc6fc98040663ab1c90dcb73dc78bc90a /sys | |
parent | f4c7456c09a561d31c5a32bd092bee2674b6f69c (diff) | |
download | FreeBSD-src-85f902e519afa7dd7e3c1b375e69d01c672307e4.zip FreeBSD-src-85f902e519afa7dd7e3c1b375e69d01c672307e4.tar.gz |
More vm_zone cleanup. The sysctl now accounts for items better, and
counts the number of allocations.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 4 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 4 | ||||
-rw-r--r-- | sys/vm/vm_zone.c | 16 | ||||
-rw-r--r-- | sys/vm/vm_zone.h | 4 |
4 files changed, 19 insertions, 9 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 4733d53..315b5c1 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.155 1997/08/05 22:06:47 dyson Exp $ + * $Id: pmap.c,v 1.156 1997/08/05 22:24:08 dyson Exp $ */ /* @@ -503,7 +503,7 @@ pmap_init(phys_start, phys_end) * init the pv free list */ pvzone = &pvzone_store; - zbootinit(pvzone, "PV entries", sizeof(pvinit[0]), pvinit, NPVINIT); + zbootinit(pvzone, "PV ENTRY", sizeof(pvinit[0]), pvinit, NPVINIT); /* * Now it is safe to enable pv_table recording. diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 4733d53..315b5c1 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.155 1997/08/05 22:06:47 dyson Exp $ + * $Id: pmap.c,v 1.156 1997/08/05 22:24:08 dyson Exp $ */ /* @@ -503,7 +503,7 @@ pmap_init(phys_start, phys_end) * init the pv free list */ pvzone = &pvzone_store; - zbootinit(pvzone, "PV entries", sizeof(pvinit[0]), pvinit, NPVINIT); + zbootinit(pvzone, "PV ENTRY", sizeof(pvinit[0]), pvinit, NPVINIT); /* * Now it is safe to enable pv_table recording. diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c index 4abb36d..cc71421 100644 --- a/sys/vm/vm_zone.c +++ b/sys/vm/vm_zone.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vm_zone.c,v 1.2 1997/08/05 22:24:30 dyson Exp $ + * $Id: vm_zone.c,v 1.3 1997/08/06 04:58:04 dyson Exp $ */ #include <sys/param.h> @@ -92,6 +92,7 @@ zinitna(vm_zone_t z, vm_object_t obj, char *name, int size, z->ztotal = 0; z->zmax = 0; z->zname = name; + z->znalloc = 0; if (zlist == 0) { zlist = z; @@ -186,6 +187,7 @@ zbootinit(vm_zone_t z, char *name, int size, void *item, int nitems) { z->zallocflag = 0; z->zpagecount = 0; z->zalloc = 0; + z->znalloc = 0; simple_lock_init(&z->zlock); for (i = 0; i < nitems; i++) { @@ -321,7 +323,7 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS int error=0; vm_zone_t curzone, nextzone; char tmpbuf[128]; - char tmpname[16]; + char tmpname[14]; for (curzone = zlist; curzone; curzone = nextzone) { int i; @@ -329,18 +331,24 @@ sysctl_vm_zone SYSCTL_HANDLER_ARGS int offset; nextzone = curzone->znext; len = strlen(curzone->zname); + if (len >= (sizeof(tmpname) - 1)) + len = (sizeof(tmpname) - 1); for(i = 0; i < sizeof(tmpname) - 1; i++) tmpname[i] = ' '; tmpname[i] = 0; memcpy(tmpname, curzone->zname, len); + tmpname[len] = ':'; offset = 0; if (curzone == zlist) { offset = 1; tmpbuf[0] = '\n'; } - sprintf(tmpbuf + offset, "%s: maxpossible=%6.6d, total=%6.6d, free=%6.6d\n", - tmpname, curzone->zmax, curzone->ztotal, curzone->zfreecnt); + sprintf(tmpbuf + offset, + "%s limit=%8.8u, used=%6.6u, free=%6.6u, requests=%8.8u\n", + tmpname, curzone->zmax, + (curzone->ztotal - curzone->zfreecnt), + curzone->zfreecnt, curzone->znalloc); len = strlen((char *)tmpbuf); if (nextzone == NULL) { diff --git a/sys/vm/vm_zone.h b/sys/vm/vm_zone.h index 39abfa1..05aab2d 100644 --- a/sys/vm/vm_zone.h +++ b/sys/vm/vm_zone.h @@ -19,7 +19,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vm_zone.h,v 1.2 1997/08/05 22:24:31 dyson Exp $ + * $Id: vm_zone.h,v 1.3 1997/08/06 04:58:05 dyson Exp $ */ #if !defined(_SYS_ZONE_H) @@ -38,6 +38,7 @@ typedef struct vm_zone { void *zitems; /* linked list of items */ int zfreecnt; /* free entries */ int zfreemin; /* minimum number of free entries */ + int znalloc; /* number of allocations */ vm_offset_t zkva; /* Base kva of zone */ int zpagecount; /* Total # of allocated pages */ int zpagemax; /* Max address space */ @@ -81,6 +82,7 @@ _zalloc(vm_zone_t z) { item = z->zitems; z->zitems = *(void **) item; z->zfreecnt--; + z->znalloc++; return item; } |