diff options
author | des <des@FreeBSD.org> | 2001-01-23 01:11:11 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-01-23 01:11:11 +0000 |
commit | 7e93e9011992d235b1e22839b4c25342284946a5 (patch) | |
tree | 7246f1fbfdc27ae1273cbd3626c10af580573cd5 /sys | |
parent | 9373359bf74ffbc59f0f8a61974096b6d8460d85 (diff) | |
download | FreeBSD-src-7e93e9011992d235b1e22839b4c25342284946a5.zip FreeBSD-src-7e93e9011992d235b1e22839b4c25342284946a5.tar.gz |
Use atomic operations to update the stat counters.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vm/vm_zone.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c index 3193c75..25e68c1 100644 --- a/sys/vm/vm_zone.c +++ b/sys/vm/vm_zone.c @@ -139,7 +139,7 @@ zinitna(vm_zone_t z, vm_object_t obj, char *name, int size, if (z->zflags & ZONE_INTERRUPT) { totsize = round_page(z->zsize * nentries); - zone_kmem_kvaspace += totsize; + atomic_add_int(zone_kmem_kvaspace, totsize); z->zkva = kmem_alloc_pageable(kernel_map, totsize); if (z->zkva == 0) return 0; @@ -279,7 +279,7 @@ _zget(vm_zone_t z) pmap_kenter(zkva, VM_PAGE_TO_PHYS(m)); bzero((caddr_t) zkva, PAGE_SIZE); z->zpagecount++; - zone_kmem_pages++; + atomic_add_int(zone_kmem_pages, 1); cnt.v_wire_count++; } nitems = (i * PAGE_SIZE) / z->zsize; @@ -304,13 +304,13 @@ _zget(vm_zone_t z) item = (void *) kmem_malloc(kmem_map, nbytes, M_WAITOK); mtx_enter(&z->zmtx, MTX_DEF); if (item != NULL) - zone_kmem_pages += z->zalloc; + atomic_add_int(zone_kmem_pages, z->zalloc); } else { mtx_exit(&z->zmtx, MTX_DEF); item = (void *) kmem_alloc(kernel_map, nbytes); mtx_enter(&z->zmtx, MTX_DEF); if (item != NULL) - zone_kern_pages += z->zalloc; + atomic_add_int(zone_kern_pages, z->zalloc); } if (item != NULL) { bzero(item, nbytes); |