diff options
author | dyson <dyson@FreeBSD.org> | 1998-04-29 04:28:22 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1998-04-29 04:28:22 +0000 |
commit | b5a79794cdadebe1ac863e5b8bde8d4b86cb8a5e (patch) | |
tree | e81f03d1aec7ca81483ab31e8815b8289c35be97 /sys/fs | |
parent | 67c7bb9c04ed76649b6be0484dcfaa84fa554bcd (diff) | |
download | FreeBSD-src-b5a79794cdadebe1ac863e5b8bde8d4b86cb8a5e.zip FreeBSD-src-b5a79794cdadebe1ac863e5b8bde8d4b86cb8a5e.tar.gz |
Tighten up management of memory and swap space during map allocation,
deallocation cycles. This should provide a measurable improvement
on swap and memory allocation on loaded systems. It is unlikely a
complete solution. Also, provide more map info with procfs.
Chuck Cranor spurred on this improvement.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/procfs/procfs_map.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index ca62755..1a865e6 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -36,7 +36,7 @@ * * @(#)procfs_status.c 8.3 (Berkeley) 2/17/94 * - * $Id: procfs_map.c,v 1.15 1998/02/04 22:32:48 eivind Exp $ + * $Id: procfs_map.c,v 1.16 1998/02/06 12:13:41 eivind Exp $ */ #include <sys/param.h> @@ -93,6 +93,7 @@ procfs_domap(curp, p, pfs, uio) ((uio->uio_resid > 0) && (entry != &map->header)); entry = entry->next) { vm_object_t obj, tobj, lobj; + int ref_count, shadow_count, id, flags; vm_offset_t addr; int resident, privateresident; char *type; @@ -117,23 +118,34 @@ procfs_domap(curp, p, pfs, uio) for( lobj = tobj = obj; tobj; tobj = tobj->backing_object) lobj = tobj; - if (lobj) switch(lobj->type) { + if (lobj) { + switch(lobj->type) { default: case OBJT_DEFAULT: - type = "default"; - break; + type = "default"; + break; case OBJT_VNODE: - type = "vnode"; - break; + type = "vnode"; + break; case OBJT_SWAP: - type = "swap"; - break; + type = "swap"; + break; case OBJT_DEVICE: - type = "device"; - break; + type = "device"; + break; + } + + flags = obj->flags; + ref_count = obj->ref_count; + shadow_count = obj->shadow_count; + id = obj->id; } else { type = "none"; + flags = 0; + ref_count = 0; + shadow_count = 0; + id = 0; } @@ -141,13 +153,15 @@ case OBJT_DEVICE: * format: * start, end, resident, private resident, cow, access, type. */ - sprintf(mebuffer, "0x%-8.8x 0x%-8.8x %9d %9d %s%s%s %s %s\n", + sprintf(mebuffer, "0x%x 0x%x %d %d %d %s%s%s %d %d 0x%x %s %s %s\n", entry->start, entry->end, - resident, privateresident, + resident, privateresident, id, (entry->protection & VM_PROT_READ)?"r":"-", (entry->protection & VM_PROT_WRITE)?"w":"-", (entry->protection & VM_PROT_EXECUTE)?"x":"-", - (entry->eflags & MAP_ENTRY_COW)?"COW":" ", + ref_count, shadow_count, flags, + (entry->eflags & MAP_ENTRY_COW)?"COW":"NCOW", + (entry->eflags & MAP_ENTRY_NEEDS_COPY)?"NC":"NNC", type); len = strlen(mebuffer); |