--- /usr/src/sys/amd64/amd64/machdep.c	2007/03/30 00:11:29
+++ amd64/amd64/machdep.c	2007/05/10 15:47:06
@@ -221,8 +221,8 @@
 	vm_ksubmap_init(&kmi);
 
 	printf("avail memory  = %ju (%ju MB)\n",
-	    ptoa((uintmax_t)cnt.v_free_count),
-	    ptoa((uintmax_t)cnt.v_free_count) / 1048576);
+	    ptoa((uintmax_t)VMGCNT_GET(free_count)),
+	    ptoa((uintmax_t)VMGCNT_GET(free_count)) / 1048576);
 
 	/*
 	 * Set up buffers, so they can be used to read disk labels.
--- /usr/src/sys/amd64/amd64/pmap.c	2007/04/25 18:17:11
+++ amd64/amd64/pmap.c	2007/05/10 15:47:06
@@ -620,7 +620,7 @@
 	 * numbers of pv entries.
 	 */
 	TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
-	pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
+	pv_entry_max = shpgperproc * maxproc + VMGCNT_GET(page_count);
 	TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
 	pv_entry_high_water = 9 * (pv_entry_max / 10);
 }
@@ -633,7 +633,7 @@
 
 	error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
 	if (error == 0 && req->newptr) {
-		shpgperproc = (pv_entry_max - cnt.v_page_count) / maxproc;
+		shpgperproc = (pv_entry_max - VMGCNT_GET(page_count)) / maxproc;
 		pv_entry_high_water = 9 * (pv_entry_max / 10);
 	}
 	return (error);
@@ -648,7 +648,7 @@
 
 	error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
 	if (error == 0 && req->newptr) {
-		pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
+		pv_entry_max = shpgperproc * maxproc + VMGCNT_GET(page_count);
 		pv_entry_high_water = 9 * (pv_entry_max / 10);
 	}
 	return (error);
@@ -1149,8 +1149,7 @@
 	 */
 	m->right = *free;
 	*free = m;
-	
-	atomic_subtract_int(&cnt.v_wire_count, 1);
+	VMGCNT_DEC(wire_count, 1);
 	return 1;
 }
 
@@ -1460,7 +1459,7 @@
 	pmap->pm_pml4[PML4PML4I] = 0;	/* Recursive Mapping */
 
 	m->wire_count--;
-	atomic_subtract_int(&cnt.v_wire_count, 1);
+	VMGCNT_DEC(wire_count, 1);
 	vm_page_free_zero(m);
 	PMAP_LOCK_DESTROY(pmap);
 }
--- /usr/src/sys/arm/arm/machdep.c	2007/02/14 04:46:47
+++ arm/arm/machdep.c	2007/05/10 15:47:06
@@ -286,8 +286,8 @@
 	vm_ksubmap_init(&kmi);
 
 	printf("avail memory = %ju (%ju MB)\n",
-	    (uintmax_t)ptoa(cnt.v_free_count),
-	    (uintmax_t)ptoa(cnt.v_free_count) / 1048576);
+	    (uintmax_t)ptoa(VMGCNT_GET(free_count)),
+	    (uintmax_t)ptoa(VMGCNT_GET(free_count)) / 1048576);
 
 	bufinit();
 	vm_pager_bufferinit();
--- /usr/src/sys/arm/arm/pmap.c	2007/02/05 10:36:06
+++ arm/arm/pmap.c	2007/05/10 15:47:06
@@ -1970,7 +1970,7 @@
 
 	TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
 	
-	pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
+	pv_entry_max = shpgperproc * maxproc + VMGCNT_GET(page_count);
 	pv_entry_high_water = 9 * (pv_entry_max / 10);
 	l2zone = uma_zcreate("L2 Table", L2_TABLE_SIZE_REAL, pmap_l2ptp_ctor,
 	    NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
--- /usr/src/sys/compat/linprocfs/linprocfs.c	2007/05/01 03:14:28
+++ compat/linprocfs/linprocfs.c	2007/05/10 15:47:06
@@ -146,14 +146,14 @@
 	/*
 	 * The correct thing here would be:
 	 *
-	memfree = cnt.v_free_count * PAGE_SIZE;
+	memfree = VMGCNT_GET(free_count) * PAGE_SIZE;
 	memused = memtotal - memfree;
 	 *
 	 * but it might mislead linux binaries into thinking there
 	 * is very little memory left, so we cheat and tell them that
 	 * all memory that isn't wired down is free.
 	 */
-	memused = cnt.v_wire_count * PAGE_SIZE;
+	memused = VMGCNT_GET(wire_count) * PAGE_SIZE;
 	memfree = memtotal - memused;
 	swap_pager_status(&i, &j);
 	swaptotal = (unsigned long long)i * PAGE_SIZE;
@@ -175,7 +175,7 @@
 	 * like unstaticizing it just for linprocfs's sake.
 	 */
 	buffers = 0;
-	cached = cnt.v_cache_count * PAGE_SIZE;
+	cached = VMGCNT_GET(cache_count) * PAGE_SIZE;
 
 	sbuf_printf(sb,
 	    "	     total:    used:	free:  shared: buffers:	 cached:\n"
@@ -394,12 +394,12 @@
 	    "intr %u\n"
 	    "ctxt %u\n"
 	    "btime %lld\n",
-	    cnt.v_vnodepgsin,
-	    cnt.v_vnodepgsout,
-	    cnt.v_swappgsin,
-	    cnt.v_swappgsout,
-	    cnt.v_intr,
-	    cnt.v_swtch,
+	    VMGCNT_GET(vnodepgsin),
+	    VMGCNT_GET(vnodepgsout),
+	    VMGCNT_GET(swappgsin),
+	    VMGCNT_GET(swappgsout),
+	    VMGCNT_GET(intr),
+	    VMGCNT_GET(swtch),
 	    (long long)boottime.tv_sec);
 	return (0);
 }
--- /usr/src/sys/compat/linux/linux_misc.c	2007/02/24 16:52:52
+++ compat/linux/linux_misc.c	2007/05/10 15:47:06
@@ -139,7 +139,7 @@
 		    LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale;
 
 	sysinfo.totalram = physmem * PAGE_SIZE;
-	sysinfo.freeram = sysinfo.totalram - cnt.v_wire_count * PAGE_SIZE;
+	sysinfo.freeram = sysinfo.totalram - VMGCNT_GET(wire_count) * PAGE_SIZE;
 
 	sysinfo.sharedram = 0;
 	mtx_lock(&vm_object_list_mtx);
--- /usr/src/sys/compat/svr4/svr4_misc.c	2006/11/06 13:48:07
+++ compat/svr4/svr4_misc.c	2007/05/10 15:47:06
@@ -778,14 +778,14 @@
 #if defined(UVM)
 		*retval = uvmexp.free;	/* XXX: free instead of total */
 #else
-		*retval = cnt.v_free_count;	/* XXX: free instead of total */
+		*retval = VMGCNT_GET(free_count);	/* XXX: free instead of total */
 #endif
 		break;
 	case SVR4_CONFIG_AVPHYS_PAGES:
 #if defined(UVM)
 		*retval = uvmexp.active;	/* XXX: active instead of avg */
 #else
-		*retval = cnt.v_active_count;	/* XXX: active instead of avg */
+		*retval = VMGCNT_GET(active_count);	/* XXX: active instead of avg */
 #endif
 		break;
 #endif /* NOTYET */
--- /usr/src/sys/fs/smbfs/smbfs_io.c	2006/08/09 17:46:32
+++ fs/smbfs/smbfs_io.c	2007/05/10 15:47:06
@@ -475,8 +475,8 @@
 
 	kva = (vm_offset_t) bp->b_data;
 	pmap_qenter(kva, pages, npages);
-	cnt.v_vnodein++;
-	cnt.v_vnodepgsin += npages;
+	VMGCNT_ADD(vnodein, 1);
+	VMGCNT_ADD(vnodepgsin, npages);
 
 	iov.iov_base = (caddr_t) kva;
 	iov.iov_len = count;
@@ -626,8 +626,8 @@
 
 	kva = (vm_offset_t) bp->b_data;
 	pmap_qenter(kva, pages, npages);
-	cnt.v_vnodeout++;
-	cnt.v_vnodepgsout += count;
+	VMGCNT_ADD(vnodeout, 1);
+	VMGCNT_ADD(vnodepgsout, count);
 
 	iov.iov_base = (caddr_t) kva;
 	iov.iov_len = count;
--- /usr/src/sys/i386/i386/machdep.c	2007/03/17 19:47:35
+++ i386/i386/machdep.c	2007/05/10 19:52:44
@@ -247,8 +247,8 @@
 	vm_ksubmap_init(&kmi);
 
 	printf("avail memory = %ju (%ju MB)\n",
-	    ptoa((uintmax_t)cnt.v_free_count),
-	    ptoa((uintmax_t)cnt.v_free_count) / 1048576);
+	    ptoa((uintmax_t)VMGCNT_GET(free_count)),
+	    ptoa((uintmax_t)VMGCNT_GET(free_count)) / 1048576);
 
 	/*
 	 * Set up buffers, so they can be used to read disk labels.
--- /usr/src/sys/i386/i386/pmap.c	2007/04/25 18:12:24
+++ i386/i386/pmap.c	2007/05/10 15:47:06
@@ -606,7 +606,7 @@
 	 * numbers of pv entries.
 	 */
 	TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
-	pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
+	pv_entry_max = shpgperproc * maxproc + VMGCNT_GET(page_count);
 	TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
 	pv_entry_max = roundup(pv_entry_max, _NPCPV);
 	pv_entry_high_water = 9 * (pv_entry_max / 10);
@@ -1168,7 +1168,7 @@
 	pmap->pm_pdir[m->pindex] = 0;
 	--pmap->pm_stats.resident_count;
 
-	atomic_subtract_int(&cnt.v_wire_count, 1);
+	VMGCNT_DEC(wire_count, 1);
 
 	/*
 	 * Do an invltlb to make the invalidated mapping
@@ -1536,7 +1536,7 @@
 		    ("pmap_release: got wrong ptd page"));
 #endif
 		m->wire_count--;
-		atomic_subtract_int(&cnt.v_wire_count, 1);
+		VMGCNT_DEC(wire_count, 1);
 		vm_page_free_zero(m);
 	}
 	PMAP_LOCK_DESTROY(pmap);
--- /usr/src/sys/ia64/ia64/machdep.c	2007/05/05 19:54:17
+++ ia64/ia64/machdep.c	2007/05/10 15:47:06
@@ -283,8 +283,8 @@
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count),
-	    ptoa(cnt.v_free_count) / 1048576);
+	printf("avail memory = %ld (%ld MB)\n", ptoa(VMGCNT_GET(free_count)),
+	    ptoa(VMGCNT_GET(free_count)) / 1048576);
  
 	if (fpswa_iface == NULL)
 		printf("Warning: no FPSWA package supplied\n");
--- /usr/src/sys/ia64/ia64/pmap.c	2007/02/21 06:02:48
+++ ia64/ia64/pmap.c	2007/05/10 15:47:06
@@ -533,7 +533,7 @@
 	pvzone = uma_zcreate("PV ENTRY", sizeof(struct pv_entry), NULL, NULL,
 	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
 	TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
-	pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
+	pv_entry_max = shpgperproc * maxproc + VMGCNT_GET(page_count);
 	TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
 	pv_entry_high_water = 9 * (pv_entry_max / 10);
 
--- /usr/src/sys/kern/init_main.c	2007/03/27 16:53:01
+++ kern/init_main.c	2007/05/10 15:47:06
@@ -467,7 +467,7 @@
 	    p->p_limit->pl_rlimit[RLIMIT_NOFILE].rlim_max = maxfiles;
 	p->p_limit->pl_rlimit[RLIMIT_NPROC].rlim_cur =
 	    p->p_limit->pl_rlimit[RLIMIT_NPROC].rlim_max = maxproc;
-	i = ptoa(cnt.v_free_count);
+	i = ptoa(VMGCNT_GET(free_count));
 	p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_max = i;
 	p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_max = i;
 	p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = i / 3;
--- /usr/src/sys/kern/kern_fork.c	2007/04/04 09:12:37
+++ kern/kern_fork.c	2007/05/10 15:47:06
@@ -665,20 +665,20 @@
 	vm_forkproc(td, p2, td2, flags);
 
 	if (flags == (RFFDG | RFPROC)) {
-		atomic_add_int(&cnt.v_forks, 1);
-		atomic_add_int(&cnt.v_forkpages, p2->p_vmspace->vm_dsize +
+		VMGCNT_ADD(forks, 1);
+		VMGCNT_ADD(forkpages, p2->p_vmspace->vm_dsize +
 		    p2->p_vmspace->vm_ssize);
 	} else if (flags == (RFFDG | RFPROC | RFPPWAIT | RFMEM)) {
-		atomic_add_int(&cnt.v_vforks, 1);
-		atomic_add_int(&cnt.v_vforkpages, p2->p_vmspace->vm_dsize +
+		VMGCNT_ADD(forks, 1);
+		VMGCNT_ADD(forkpages, p2->p_vmspace->vm_dsize +
 		    p2->p_vmspace->vm_ssize);
 	} else if (p1 == &proc0) {
-		atomic_add_int(&cnt.v_kthreads, 1);
-		atomic_add_int(&cnt.v_kthreadpages, p2->p_vmspace->vm_dsize +
+		VMGCNT_ADD(kthreads, 1);
+		VMGCNT_ADD(kthreadpages, p2->p_vmspace->vm_dsize +
 		    p2->p_vmspace->vm_ssize);
 	} else {
-		atomic_add_int(&cnt.v_rforks, 1);
-		atomic_add_int(&cnt.v_rforkpages, p2->p_vmspace->vm_dsize +
+		VMGCNT_ADD(rforks, 1);
+		VMGCNT_ADD(rforkpages, p2->p_vmspace->vm_dsize +
 		    p2->p_vmspace->vm_ssize);
 	}
 
--- /usr/src/sys/kern/kern_malloc.c	2007/04/21 01:17:04
+++ kern/kern_malloc.c	2007/05/10 15:47:06
@@ -551,7 +551,7 @@
 	 * so make sure that there is enough space.
 	 */
 	vm_kmem_size = VM_KMEM_SIZE + nmbclusters * PAGE_SIZE;
-	mem_size = cnt.v_page_count;
+	mem_size = VMGCNT_GET(page_count);
 
 #if defined(VM_KMEM_SIZE_SCALE)
 	vm_kmem_size_scale = VM_KMEM_SIZE_SCALE;
@@ -589,8 +589,8 @@
 	 * to something sane. Be careful to not overflow the 32bit
 	 * ints while doing the check.
 	 */
-	if (((vm_kmem_size / 2) / PAGE_SIZE) > cnt.v_page_count)
-		vm_kmem_size = 2 * cnt.v_page_count * PAGE_SIZE;
+	if (((vm_kmem_size / 2) / PAGE_SIZE) > VMGCNT_GET(page_count))
+		vm_kmem_size = 2 * VMGCNT_GET(page_count) * PAGE_SIZE;
 
 	/*
 	 * Tune settings based on the kernel map's size at this time.
@@ -650,7 +650,8 @@
 	struct malloc_type_internal *mtip;
 	struct malloc_type *mtp;
 
-	KASSERT(cnt.v_page_count != 0, ("malloc_register before vm_init"));
+	KASSERT(VMGCNT_GET(page_count) != 0,
+	    ("malloc_register before vm_init"));
 
 	mtp = data;
 	mtip = uma_zalloc(mt_zone, M_WAITOK | M_ZERO);
--- /usr/src/sys/kern/kern_mib.c	2007/05/16 16:13:40
+++ kern/kern_mib.c	2007/05/16 21:04:21
@@ -177,7 +177,7 @@
 {
 	u_long val;
 
-	val = ctob(physmem - cnt.v_wire_count);
+	val = ctob(physmem - VMGCNT_GET(wire_count));
 	return (sysctl_handle_long(oidp, &val, 0, req));
 }
 
--- /usr/src/sys/kern/kern_synch.c	2007/05/08 21:52:37
+++ kern/kern_synch.c	2007/05/10 15:47:06
@@ -433,7 +433,7 @@
 	/*
 	 * Finish up stats for outgoing thread.
 	 */
-	cnt.v_swtch++;
+	VMGCNT_ADD(swtch, 1);
 	PCPU_SET(switchtime, new_switchtime);
 	PCPU_SET(switchticks, ticks);
 	CTR4(KTR_PROC, "mi_switch: old thread %ld (kse %p, pid %ld, %s)",
--- /usr/src/sys/kern/kern_thread.c	2007/03/27 16:53:01
+++ kern/kern_thread.c	2007/05/10 15:47:06
@@ -407,7 +407,7 @@
 	p->p_rux.rux_iticks += td->td_iticks;
 	PCPU_SET(switchtime, new_switchtime);
 	PCPU_SET(switchticks, ticks);
-	cnt.v_swtch++;
+	VMGCNT_ADD(swtch, 1);
 
 	/* Add our usage into the usage of all our children. */
 	if (p->p_numthreads == 1)
--- /usr/src/sys/kern/subr_trap.c	2007/03/04 22:41:05
+++ kern/subr_trap.c	2007/05/10 15:47:06
@@ -191,8 +191,8 @@
 #endif
 	td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK |
 	    TDF_NEEDRESCHED | TDF_INTERRUPT);
-	cnt.v_trap++;
 	mtx_unlock_spin(&sched_lock);
+	VMGCNT_ADD(trap, 1);
 
 	/*
 	 * XXXKSE While the fact that we owe a user profiling
--- /usr/src/sys/kern/vfs_bio.c	2007/04/24 11:04:30
+++ kern/vfs_bio.c	2007/05/10 15:47:06
@@ -2919,8 +2919,10 @@
 				 */
 				if ((curproc != pageproc) &&
 				    (VM_PAGE_INQUEUE1(m, PQ_CACHE)) &&
-				    ((cnt.v_free_count + cnt.v_cache_count) <
-			 		(cnt.v_free_min + cnt.v_cache_min))) {
+				    ((VMGCNT_GET(free_count) +
+				    VMGCNT_GET(cache_count)) <
+				    (VMGCNT_GET(free_min) +
+				    VMGCNT_GET(cache_min)))) {
 					pagedaemon_wakeup();
 				}
 				vm_page_wire(m);
--- /usr/src/sys/kern/vfs_subr.c	2007/04/13 23:57:04
+++ kern/vfs_subr.c	2007/05/10 15:47:06
@@ -297,8 +297,9 @@
 	 * of the kernel's heap size is consumed by vnodes and vm
 	 * objects.
 	 */
-	desiredvnodes = min(maxproc + cnt.v_page_count / 4, 2 * vm_kmem_size /
-	    (5 * (sizeof(struct vm_object) + sizeof(struct vnode))));
+	desiredvnodes = min(maxproc + VMGCNT_GET(page_count) / 4, 2 *
+	    vm_kmem_size / (5 * (sizeof(struct vm_object) +
+	    sizeof(struct vnode))));
 	if (desiredvnodes > MAXVNODES_MAX) {
 		if (bootverbose)
 			printf("Reducing kern.maxvnodes %d -> %d\n",
@@ -581,7 +582,7 @@
 	usevnodes = desiredvnodes;
 	if (usevnodes <= 0)
 		usevnodes = 1;
-	trigger = cnt.v_page_count * 2 / usevnodes;
+	trigger = VMGCNT_GET(page_count) * 2 / usevnodes;
 	done = 0;
 	td = curthread;
 	vn_start_write(NULL, &mp, V_WAIT);
--- /usr/src/sys/nfsclient/nfs_bio.c	2007/04/25 20:37:13
+++ nfsclient/nfs_bio.c	2007/05/10 15:47:06
@@ -159,8 +159,8 @@
 
 	kva = (vm_offset_t) bp->b_data;
 	pmap_qenter(kva, pages, npages);
-	cnt.v_vnodein++;
-	cnt.v_vnodepgsin += npages;
+	VMGCNT_ADD(vnodein, 1);
+	VMGCNT_ADD(vnodepgsin, npages);
 
 	iov.iov_base = (caddr_t) kva;
 	iov.iov_len = count;
@@ -323,8 +323,8 @@
 
 	kva = (vm_offset_t) bp->b_data;
 	pmap_qenter(kva, pages, npages);
-	cnt.v_vnodeout++;
-	cnt.v_vnodepgsout += count;
+	VMGCNT_ADD(vnodeout, 1);
+	VMGCNT_ADD(vnodepgsout, count);
 
 	iov.iov_base = (caddr_t) kva;
 	iov.iov_len = count;
--- /usr/src/sys/pc98/pc98/machdep.c	2007/03/18 03:27:21
+++ pc98/pc98/machdep.c	2007/05/10 15:47:06
@@ -244,8 +244,8 @@
 	vm_ksubmap_init(&kmi);
 
 	printf("avail memory = %ju (%ju MB)\n",
-	    ptoa((uintmax_t)cnt.v_free_count),
-	    ptoa((uintmax_t)cnt.v_free_count) / 1048576);
+	    ptoa((uintmax_t)VMGCNT_GET(free_count)),
+	    ptoa((uintmax_t)VMGCNT_GET(free_count)) / 1048576);
 
 	/*
 	 * Set up buffers, so they can be used to read disk labels.
--- /usr/src/sys/powerpc/powerpc/machdep.c	2007/02/12 09:03:53
+++ powerpc/powerpc/machdep.c	2007/05/10 15:47:06
@@ -223,8 +223,8 @@
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count),
-	    ptoa(cnt.v_free_count) / 1048576);
+	printf("avail memory = %ld (%ld MB)\n", ptoa(VMGCNT_GET(free_count)),
+	    ptoa(VMGCNT_GET(free_count)) / 1048576);
 
 	/*
 	 * Set up buffers, so they can be used to read disk labels.
--- /usr/src/sys/sparc64/sparc64/machdep.c	2007/05/01 16:22:38
+++ sparc64/sparc64/machdep.c	2007/05/10 15:47:06
@@ -211,8 +211,8 @@
 	EVENTHANDLER_REGISTER(shutdown_final, sparc64_shutdown_final, NULL,
 	    SHUTDOWN_PRI_LAST);
 
-	printf("avail memory = %lu (%lu MB)\n", cnt.v_free_count * PAGE_SIZE,
-	    cnt.v_free_count / ((1024 * 1024) / PAGE_SIZE));
+	printf("avail memory = %lu (%lu MB)\n", VMGCNT_GET(free_count) *
+	    PAGE_SIZE, VMGCNT_GET(free_count) / ((1024 * 1024) / PAGE_SIZE));
 
 	if (bootverbose)
 		printf("machine: %s\n", sparc64_model);
--- /usr/src/sys/sparc64/sparc64/pmap.c	2006/11/12 21:52:34
+++ sparc64/sparc64/pmap.c	2007/05/10 15:47:06
@@ -1088,7 +1088,7 @@
 		    ("pmap_release: freeing held tsb page"));
 		m->md.pmap = NULL;
 		m->wire_count--;
-		atomic_subtract_int(&cnt.v_wire_count, 1);
+		VMGCNT_DEC(wire_count, 1);
 		vm_page_free_zero(m);
 		vm_page_unlock_queues();
 	}
--- /usr/src/sys/sun4v/sun4v/machdep.c	2006/12/06 06:37:04
+++ sun4v/sun4v/machdep.c	2007/05/10 15:47:06
@@ -223,8 +223,8 @@
 	EVENTHANDLER_REGISTER(shutdown_final, sparc64_shutdown_final, NULL,
 	    SHUTDOWN_PRI_LAST);
 
-	printf("avail memory = %lu (%lu MB)\n", cnt.v_free_count * PAGE_SIZE,
-	    cnt.v_free_count / ((1024 * 1024) / PAGE_SIZE));
+	printf("avail memory = %lu (%lu MB)\n", VMGCNT_GET(free_count) *
+	    PAGE_SIZE, VMGCNT_GET(free_count) / ((1024 * 1024) / PAGE_SIZE));
 
 	if (bootverbose)
 		printf("machine: %s\n", sparc64_model);
--- /usr/src/sys/sun4v/sun4v/pmap.c	2006/12/31 02:51:44
+++ sun4v/sun4v/pmap.c	2007/05/10 15:47:06
@@ -975,7 +975,7 @@
 	 * way below the low water mark of free pages or way
 	 * above high water mark of used pv entries.
 	 */
-	if (cnt.v_free_count < cnt.v_free_reserved ||
+	if (VMGCNT_GET(free_count) < VMGCNT_GET(free_reserved) ||
 	    pv_entry_count > pv_entry_high_water)
 		return;
 	
@@ -1318,7 +1318,7 @@
 	m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)ptr));
 	for (i = 0; i < npages; i++, m++) {
 		m->wire_count--;
-		atomic_subtract_int(&cnt.v_wire_count, 1);
+		VMGCNT_DEC(wire_count, 1);
 		vm_page_free(m);
 	}
 }
@@ -1349,7 +1349,7 @@
 	pvzone = uma_zcreate("PV ENTRY", sizeof(struct pv_entry), NULL, NULL, 
 	    NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
 	TUNABLE_INT_FETCH("vm.pmap.shpgperproc", &shpgperproc);
-	pv_entry_max = shpgperproc * maxproc + cnt.v_page_count;
+	pv_entry_max = shpgperproc * maxproc + VMGCNT_GET(page_count);
 	TUNABLE_INT_FETCH("vm.pmap.pv_entries", &pv_entry_max);
 	pv_entry_high_water = 9 * (pv_entry_max / 10);
 	uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max);
--- /usr/src/sys/sun4v/sun4v/tsb.c	2006/12/18 07:52:23
+++ sun4v/sun4v/tsb.c	2007/05/10 15:47:06
@@ -104,7 +104,7 @@
 	m = PHYS_TO_VM_PAGE((vm_paddr_t)hvtsb->hti_ra);
 	for (i = 0, tm = m; i < TSB_SIZE; i++, m++) {
 		tm->wire_count--;
-		atomic_subtract_int(&cnt.v_wire_count, 1);
+		VMGCNT_DEC(wire_count, 1);
 		vm_page_free(tm);
 	}
 }
--- /usr/src/sys/sun4v/sun4v/tte_hash.c	2006/12/17 01:03:05
+++ sun4v/sun4v/tte_hash.c	2007/05/10 15:47:06
@@ -231,7 +231,7 @@
         for (fh = ptr; fh != NULL; fh = fh->thf_head.fh_next) {
                 m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)fh));
                 m->wire_count--;
-		atomic_subtract_int(&cnt.v_wire_count, 1);
+		VMGCNT_GET(wire_count, 1);
                 vm_page_free(m);
         }
 }
--- /usr/src/sys/sys/vmmeter.h	2006/11/28 12:47:06
+++ sys/vmmeter.h	2007/05/11 08:37:21
@@ -102,7 +102,18 @@
 };
 #ifdef _KERNEL
 
-extern struct vmmeter cnt;
+extern volatile struct vmmeter cnt;
+
+#define	VMGCNT	__DEVOLATILE(struct vmmeter *, &cnt)
+#define	VMGCNT_SET(member, val)						\
+	atomic_store_rel_int(__CONCAT(&cnt.v_, member), val)
+#define	VMGCNT_ADD(member, val)						\
+	atomic_add_int(__CONCAT(&cnt.v_, member), val)
+#define	VMGCNT_DEC(member, val)						\
+	atomic_subtract_int(__CONCAT(&cnt.v_, member), val)
+#define	VMGCNT_GET(member)	(__CONCAT(cnt.v_, member))
+#define	VMGCNT_PTR(member)						\
+	__DEVOLATILE(u_int *, __CONCAT(&cnt.v_, member))
 
 /*
  * Return TRUE if we are under our reserved low-free-pages threshold
@@ -112,7 +123,8 @@
 int
 vm_page_count_reserved(void)
 {
-    return (cnt.v_free_reserved > (cnt.v_free_count + cnt.v_cache_count));
+    return (VMGCNT_GET(free_reserved) > (VMGCNT_GET(free_count) +
+        VMGCNT_GET(cache_count)));
 }
 
 /*
@@ -126,7 +138,8 @@
 int
 vm_page_count_severe(void)
 {
-    return (cnt.v_free_severe > (cnt.v_free_count + cnt.v_cache_count));
+    return (VMGCNT_GET(free_severe) > (VMGCNT_GET(free_count) +
+        VMGCNT_GET(cache_count)));
 }
 
 /*
@@ -143,7 +156,8 @@
 int
 vm_page_count_min(void)
 {
-    return (cnt.v_free_min > (cnt.v_free_count + cnt.v_cache_count));
+    return (VMGCNT_GET(free_min) > (VMGCNT_GET(free_count) +
+        VMGCNT_GET(cache_count)));
 }
 
 /*
@@ -155,7 +169,8 @@
 int
 vm_page_count_target(void)
 {
-    return (cnt.v_free_target > (cnt.v_free_count + cnt.v_cache_count));
+    return (VMGCNT_GET(free_target) > (VMGCNT_GET(free_count) +
+        VMGCNT_GET(cache_count)));
 }
 
 /*
@@ -168,8 +183,8 @@
 vm_paging_target(void)
 {
     return (
-	(cnt.v_free_target + cnt.v_cache_min) - 
-	(cnt.v_free_count + cnt.v_cache_count)
+	(VMGCNT_GET(free_target) + VMGCNT_GET(cache_min)) - 
+	(VMGCNT_GET(free_count) + VMGCNT_GET(cache_count))
     );
 }
 
@@ -182,8 +197,8 @@
 vm_paging_needed(void)
 {
     return (
-	(cnt.v_free_reserved + cnt.v_cache_min) >
-	(cnt.v_free_count + cnt.v_cache_count)
+	(VMGCNT_GET(free_reserved) + VMGCNT_GET(cache_min)) >
+	(VMGCNT_GET(free_count) + VMGCNT_GET(cache_count))
     );
 }
 
--- /usr/src/sys/vm/swap_pager.c	2007/04/23 14:47:16
+++ vm/swap_pager.c	2007/05/10 15:47:06
@@ -385,7 +385,7 @@
 	 * can hold 16 pages, so this is probably overkill.  This reservation
 	 * is typically limited to around 32MB by default.
 	 */
-	n = cnt.v_page_count / 2;
+	n = VMGCNT_GET(page_count) / 2;
 	if (maxswzone && n > maxswzone / sizeof(struct swblock))
 		n = maxswzone / sizeof(struct swblock);
 	n2 = n;
@@ -1037,8 +1037,8 @@
 	}
 	bp->b_npages = j - i;
 
-	cnt.v_swapin++;
-	cnt.v_swappgsin += bp->b_npages;
+	VMGCNT_ADD(swapin, 1);
+	VMGCNT_ADD(swappgsin, bp->b_npages);
 
 	/*
 	 * We still hold the lock on mreq, and our automatic completion routine
@@ -1072,7 +1072,7 @@
 		vm_page_lock_queues();
 		vm_page_flag_set(mreq, PG_REFERENCED);
 		vm_page_unlock_queues();
-		cnt.v_intrans++;
+		VMGCNT_ADD(intrans, 1);
 		if (msleep(mreq, VM_OBJECT_MTX(object), PSWP, "swread", hz*20)) {
 			printf(
 "swap_pager: indefinite wait buffer: bufobj: %p, blkno: %jd, size: %ld\n",
@@ -1263,8 +1263,8 @@
 		bp->b_dirtyoff = 0;
 		bp->b_dirtyend = bp->b_bcount;
 
-		cnt.v_swapout++;
-		cnt.v_swappgsout += bp->b_npages;
+		VMGCNT_ADD(swapout, 1);
+		VMGCNT_ADD(swappgsout, bp->b_npages);
 
 		/*
 		 * asynchronous
@@ -2135,8 +2135,8 @@
 	 * of data we will have to page back in, plus an epsilon so
 	 * the system doesn't become critically low on swap space.
 	 */
-	if (cnt.v_free_count + cnt.v_cache_count + swap_pager_avail <
-	    nblks + nswap_lowat) {
+	if (VMGCNT_GET(free_count) + VMGCNT_GET(cache_count) +
+	    swap_pager_avail < nblks + nswap_lowat) {
 		return (ENOMEM);
 	}
 
--- /usr/src/sys/vm/uma_core.c	2007/02/11 20:17:10
+++ vm/uma_core.c	2007/05/10 15:47:06
@@ -271,7 +271,7 @@
 static void
 bucket_enable(void)
 {
-	if (cnt.v_free_count < cnt.v_free_min)
+	if (VMGCNT_GET(free_count) < VMGCNT_GET(free_min))
 		bucketdisable = 1;
 	else
 		bucketdisable = 0;
--- /usr/src/sys/vm/vm_contig.c	2007/04/19 05:41:36
+++ vm/vm_contig.c	2007/05/10 15:47:06
@@ -204,7 +204,7 @@
 		 * Find first page in array that is free, within range,
 		 * aligned, and such that the boundary won't be crossed.
 		 */
-		for (i = start; i < cnt.v_page_count; i++) {
+		for (i = start; i < VMGCNT_GET(page_count); i++) {
 			phys = VM_PAGE_TO_PHYS(&pga[i]);
 			pqtype = pga[i].queue - pga[i].pc;
 			if (((pqtype == PQ_FREE) || (pqtype == PQ_CACHE)) &&
@@ -217,7 +217,7 @@
 		/*
 		 * If the above failed or we will exceed the upper bound, fail.
 		 */
-		if ((i == cnt.v_page_count) ||
+		if ((i == VMGCNT_GET(page_count)) ||
 			((VM_PAGE_TO_PHYS(&pga[i]) + size) > high)) {
 			mtx_unlock(&vm_page_queue_free_mtx);
 			/*
--- /usr/src/sys/vm/vm_fault.c	2007/04/05 20:52:22
+++ vm/vm_fault.c	2007/05/10 15:47:06
@@ -1271,7 +1271,8 @@
 	 * try to do any readahead that we might have free pages for.
 	 */
 	if ((rahead + rbehind) >
-		((cnt.v_free_count + cnt.v_cache_count) - cnt.v_free_reserved)) {
+		((VMGCNT_GET(free_count) + VMGCNT_GET(cache_count)) -
+		VMGCNT_GET(free_reserved))) {
 		pagedaemon_wakeup();
 		marray[0] = m;
 		*reqpage = 0;
--- /usr/src/sys/vm/vm_glue.c	2007/01/23 08:52:34
+++ vm/vm_glue.c	2007/05/10 15:47:06
@@ -219,7 +219,7 @@
 	 * Also, the sysctl code, which is the only present user
 	 * of vslock(), does a hard loop on EAGAIN.
 	 */
-	if (npages + cnt.v_wire_count > vm_page_max_wired)
+	if (npages + VMGCNT_GET(wire_count) > vm_page_max_wired)
 		return (EAGAIN);
 #endif
 	error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end,
@@ -589,7 +589,7 @@
 	limp->pl_rlimit[RLIMIT_DATA].rlim_cur = dfldsiz;
 	limp->pl_rlimit[RLIMIT_DATA].rlim_max = maxdsiz;
 	/* limit the limit to no less than 2MB */
-	rss_limit = max(cnt.v_free_count, 512);
+	rss_limit = max(VMGCNT_GET(free_count), 512);
 	limp->pl_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit);
 	limp->pl_rlimit[RLIMIT_RSS].rlim_max = RLIM_INFINITY;
 }
--- /usr/src/sys/vm/vm_map.c	2007/04/26 05:53:38
+++ vm/vm_map.c	2007/05/10 15:47:06
@@ -274,7 +274,7 @@
 void
 vm_init2(void)
 {
-	uma_zone_set_obj(kmapentzone, &kmapentobj, lmin(cnt.v_page_count,
+	uma_zone_set_obj(kmapentzone, &kmapentobj, lmin(VMGCNT_GET(page_count),
 	    (VM_MAX_KERNEL_ADDRESS - KERNBASE) / PAGE_SIZE) / 8 +
 	     maxproc * 2 + maxfiles);
 	vmspace_zone = uma_zcreate("VMSPACE", sizeof(struct vmspace), NULL,
@@ -1488,7 +1488,7 @@
 		 * free pages allocating pv entries.
 		 */
 		if ((flags & MAP_PREFAULT_MADVISE) &&
-		    cnt.v_free_count < cnt.v_free_reserved) {
+		    VMGCNT_GET(free_count) < VMGCNT_GET(free_reserved)) {
 			psize = tmpidx;
 			break;
 		}
--- /usr/src/sys/vm/vm_meter.c	2006/11/20 08:36:24
+++ vm/vm_meter.c	2007/05/11 08:37:21
@@ -52,26 +52,26 @@
 #include <vm/vm_object.h>
 #include <sys/sysctl.h>
 
-struct vmmeter cnt;
+volatile struct vmmeter cnt;
 
 int maxslp = MAXSLP;
 
 SYSCTL_UINT(_vm, VM_V_FREE_MIN, v_free_min,
-	CTLFLAG_RW, &cnt.v_free_min, 0, "");
+	CTLFLAG_RW, VMGCNT_PTR(free_min), 0, "");
 SYSCTL_UINT(_vm, VM_V_FREE_TARGET, v_free_target,
-	CTLFLAG_RW, &cnt.v_free_target, 0, "");
+	CTLFLAG_RW, VMGCNT_PTR(free_target), 0, "");
 SYSCTL_UINT(_vm, VM_V_FREE_RESERVED, v_free_reserved,
-	CTLFLAG_RW, &cnt.v_free_reserved, 0, "");
+	CTLFLAG_RW, VMGCNT_PTR(free_reserved), 0, "");
 SYSCTL_UINT(_vm, VM_V_INACTIVE_TARGET, v_inactive_target,
-	CTLFLAG_RW, &cnt.v_inactive_target, 0, "");
+	CTLFLAG_RW, VMGCNT_PTR(inactive_target), 0, "");
 SYSCTL_UINT(_vm, VM_V_CACHE_MIN, v_cache_min,
-	CTLFLAG_RW, &cnt.v_cache_min, 0, "");
+	CTLFLAG_RW, VMGCNT_PTR(cache_min), 0, "");
 SYSCTL_UINT(_vm, VM_V_CACHE_MAX, v_cache_max,
-	CTLFLAG_RW, &cnt.v_cache_max, 0, "");
+	CTLFLAG_RW, VMGCNT_PTR(cache_max), 0, "");
 SYSCTL_UINT(_vm, VM_V_PAGEOUT_FREE_MIN, v_pageout_free_min,
-	CTLFLAG_RW, &cnt.v_pageout_free_min, 0, "");
+	CTLFLAG_RW, VMGCNT_PTR(pageout_free_min), 0, "");
 SYSCTL_UINT(_vm, OID_AUTO, v_free_severe,
-	CTLFLAG_RW, &cnt.v_free_severe, 0, "");
+	CTLFLAG_RW, VMGCNT_PTR(free_severe), 0, "");
 
 static int
 sysctl_vm_loadavg(SYSCTL_HANDLER_ARGS)
@@ -235,7 +235,7 @@
 		}
 	}
 	mtx_unlock(&vm_object_list_mtx);
-	total.t_free = cnt.v_free_count + cnt.v_cache_count;
+	total.t_free = VMGCNT_GET(free_count) + VMGCNT_GET(cache_count);
 	return (sysctl_handle_opaque(oidp, &total, sizeof(total), req));
 }
 
@@ -255,7 +255,7 @@
 vcnt(SYSCTL_HANDLER_ARGS)
 {
 	int count = *(int *)arg1;
-	int offset = (char *)arg1 - (char *)&cnt;
+	int offset = (char *)arg1 - (char *)VMGCNT;
 #ifdef SMP
 	int i;
 
@@ -280,101 +280,103 @@
 SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats");
 
 SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_swtch, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_swtch, 0, vcnt, "IU", "Context switches");
+	VMGCNT_PTR(swtch), 0, vcnt, "IU", "Context switches");
 SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_trap, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_trap, 0, vcnt, "IU", "Traps");
+	VMGCNT_PTR(trap), 0, vcnt, "IU", "Traps");
 SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_syscall, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_syscall, 0, vcnt, "IU", "Syscalls");
+	VMGCNT_PTR(syscall), 0, vcnt, "IU", "Syscalls");
 SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_intr, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_intr, 0, vcnt, "IU", "Hardware interrupts");
+	VMGCNT_PTR(intr), 0, vcnt, "IU", "Hardware interrupts");
 SYSCTL_PROC(_vm_stats_sys, OID_AUTO, v_soft, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_soft, 0, vcnt, "IU", "Software interrupts");
+	VMGCNT_PTR(soft), 0, vcnt, "IU", "Software interrupts");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vm_faults, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_vm_faults, 0, vcnt, "IU", "VM faults");
+	VMGCNT_PTR(vm_faults), 0, vcnt, "IU", "VM faults");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cow_faults, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_cow_faults, 0, vcnt, "IU", "COW faults");
+	VMGCNT_PTR(cow_faults), 0, vcnt, "IU", "COW faults");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cow_optim, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_cow_optim, 0, vcnt, "IU", "Optimized COW faults");
+	VMGCNT_PTR(cow_optim), 0, vcnt, "IU", "Optimized COW faults");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_zfod, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_zfod, 0, vcnt, "IU", "Zero fill");
+	VMGCNT_PTR(zfod), 0, vcnt, "IU", "Zero fill");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_ozfod, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_ozfod, 0, vcnt, "IU", "Optimized zero fill");
+	VMGCNT_PTR(ozfod), 0, vcnt, "IU", "Optimized zero fill");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swapin, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_swapin, 0, vcnt, "IU", "Swapin operations");
+	VMGCNT_PTR(swapin), 0, vcnt, "IU", "Swapin operations");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swapout, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_swapout, 0, vcnt, "IU", "Swapout operations");
+	VMGCNT_PTR(swapout), 0, vcnt, "IU", "Swapout operations");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swappgsin, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_swappgsin, 0, vcnt, "IU", "Swapin pages");
+	VMGCNT_PTR(swappgsin), 0, vcnt, "IU", "Swapin pages");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_swappgsout, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_swappgsout, 0, vcnt, "IU", "Swapout pages");
+	VMGCNT_PTR(swappgsout), 0, vcnt, "IU", "Swapout pages");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodein, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_vnodein, 0, vcnt, "IU", "Vnodein operations");
+	VMGCNT_PTR(vnodein), 0, vcnt, "IU", "Vnodein operations");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodeout, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_vnodeout, 0, vcnt, "IU", "Vnodeout operations");
+	VMGCNT_PTR(vnodeout), 0, vcnt, "IU", "Vnodeout operations");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodepgsin, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_vnodepgsin, 0, vcnt, "IU", "Vnodein pages");
+	VMGCNT_PTR(vnodepgsin), 0, vcnt, "IU", "Vnodein pages");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vnodepgsout, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_vnodepgsout, 0, vcnt, "IU", "Vnodeout pages");
+	VMGCNT_PTR(vnodepgsout), 0, vcnt, "IU", "Vnodeout pages");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_intrans, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_intrans, 0, vcnt, "IU", "In transit page blocking");
+	VMGCNT_PTR(intrans), 0, vcnt, "IU", "In transit page blocking");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_reactivated, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_reactivated, 0, vcnt, "IU", "Reactivated pages");
+	VMGCNT_PTR(reactivated), 0, vcnt, "IU", "Reactivated pages");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdwakeups, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_pdwakeups, 0, vcnt, "IU", "Pagedaemon wakeups");
+	VMGCNT_PTR(pdwakeups), 0, vcnt, "IU", "Pagedaemon wakeups");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdpages, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_pdpages, 0, vcnt, "IU", "Pagedaemon page scans");
+	VMGCNT_PTR(pdpages), 0, vcnt, "IU", "Pagedaemon page scans");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_dfree, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_dfree, 0, vcnt, "IU", "");
+	VMGCNT_PTR(dfree), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pfree, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_pfree, 0, vcnt, "IU", "");
+	VMGCNT_PTR(pfree), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_tfree, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_tfree, 0, vcnt, "IU", "");
+	VMGCNT_PTR(tfree), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_page_size, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_page_size, 0, vcnt, "IU", "");
+	VMGCNT_PTR(page_size), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_page_count, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_page_count, 0, vcnt, "IU", "");
+	VMGCNT_PTR(page_count), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_reserved, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_free_reserved, 0, vcnt, "IU", "");
+	VMGCNT_PTR(free_reserved), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_target, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_free_target, 0, vcnt, "IU", "");
+	VMGCNT_PTR(free_target), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_min, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_free_min, 0, vcnt, "IU", "");
+	VMGCNT_PTR(free_min), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_free_count, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_free_count, 0, vcnt, "IU", "");
+	VMGCNT_PTR(free_count), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_wire_count, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_wire_count, 0, vcnt, "IU", "");
+	VMGCNT_PTR(wire_count), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_active_count, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_active_count, 0, vcnt, "IU", "");
+	VMGCNT_PTR(active_count), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_inactive_target, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_inactive_target, 0, vcnt, "IU", "");
+	VMGCNT_PTR(inactive_target), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_inactive_count, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_inactive_count, 0, vcnt, "IU", "");
+	VMGCNT_PTR(inactive_count), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_count, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_cache_count, 0, vcnt, "IU", "");
+	VMGCNT_PTR(cache_count), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_min, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_cache_min, 0, vcnt, "IU", "");
+	VMGCNT_PTR(cache_min), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_cache_max, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_cache_max, 0, vcnt, "IU", "");
+	VMGCNT_PTR(cache_max), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pageout_free_min, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_pageout_free_min, 0, vcnt, "IU", "");
-SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_interrupt_free_min, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_interrupt_free_min, 0, vcnt, "IU", "");
+	VMGCNT_PTR(pageout_free_min), 0, vcnt, "IU", "");
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_interrupt_free_min, CTLTYPE_UINT |
+	CTLFLAG_RD, VMGCNT_PTR(interrupt_free_min), 0, vcnt, "IU", "");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_forks, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_forks, 0, vcnt, "IU", "Number of fork() calls");
+	VMGCNT_PTR(forks), 0, vcnt, "IU", "Number of fork() calls");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vforks, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_vforks, 0, vcnt, "IU", "Number of vfork() calls");
+	VMGCNT_PTR(vforks), 0, vcnt, "IU", "Number of vfork() calls");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_rforks, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_rforks, 0, vcnt, "IU", "Number of rfork() calls");
+	VMGCNT_PTR(rforks), 0, vcnt, "IU", "Number of rfork() calls");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_kthreads, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_kthreads, 0, vcnt, "IU", "Number of fork() calls by kernel");
+	VMGCNT_PTR(kthreads), 0, vcnt, "IU",
+	"Number of fork() calls by kernel");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_forkpages, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_forkpages, 0, vcnt, "IU", "VM pages affected by fork()");
+	VMGCNT_PTR(forkpages), 0, vcnt, "IU", "VM pages affected by fork()");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_vforkpages, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_vforkpages, 0, vcnt, "IU", "VM pages affected by vfork()");
+	VMGCNT_PTR(vforkpages), 0, vcnt, "IU", "VM pages affected by vfork()");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_rforkpages, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_rforkpages, 0, vcnt, "IU", "VM pages affected by rfork()");
+	VMGCNT_PTR(rforkpages), 0, vcnt, "IU", "VM pages affected by rfork()");
 SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_kthreadpages, CTLTYPE_UINT|CTLFLAG_RD,
-	&cnt.v_kthreadpages, 0, vcnt, "IU", "VM pages affected by fork() by kernel");
+	VMGCNT_PTR(kthreadpages), 0, vcnt, "IU",
+	"VM pages affected by fork() by kernel");
 
 SYSCTL_INT(_vm_stats_misc, OID_AUTO,
 	zero_page_count, CTLFLAG_RD, &vm_page_zero_count, 0, "");
--- /usr/src/sys/vm/vm_mmap.c	2006/11/06 13:43:21
+++ vm/vm_mmap.c	2007/05/10 15:47:06
@@ -974,7 +974,7 @@
 		return (ENOMEM);
 	}
 	PROC_UNLOCK(proc);
-	if (npages + cnt.v_wire_count > vm_page_max_wired)
+	if (npages + VMGCNT_GET(wire_count) > vm_page_max_wired)
 		return (EAGAIN);
 	error = vm_map_wire(&proc->p_vmspace->vm_map, start, end,
 	    VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES);
--- /usr/src/sys/vm/vm_object.c	2007/03/27 08:58:09
+++ vm/vm_object.c	2007/05/10 15:47:06
@@ -655,7 +655,7 @@
 			"p->busy = %d, p->flags %x\n", p, p->busy, p->flags));
 		if (p->wire_count == 0) {
 			vm_page_free(p);
-			cnt.v_pfree++;
+			VMGCNT_ADD(pfree, 1);
 		} else {
 			vm_page_remove(p);
 		}
--- /usr/src/sys/vm/vm_page.c	2007/05/05 19:54:17
+++ vm/vm_page.c	2007/05/10 22:48:38
@@ -151,9 +151,9 @@
 void
 vm_set_page_size(void)
 {
-	if (cnt.v_page_size == 0)
-		cnt.v_page_size = PAGE_SIZE;
-	if (((cnt.v_page_size - 1) & cnt.v_page_size) != 0)
+	if (VMGCNT_GET(page_size) == 0)
+		VMGCNT_SET(page_size, PAGE_SIZE);
+	if (((VMGCNT_GET(page_size) - 1) & VMGCNT_GET(page_size)) != 0)
 		panic("vm_set_page_size: page size not a power of two");
 }
 
@@ -357,8 +357,8 @@
 	 * last rather than first.  On large-memory machines, this avoids
 	 * the exhaustion of low physical memory before isa_dma_init has run.
 	 */
-	cnt.v_page_count = 0;
-	cnt.v_free_count = 0;
+	VMGCNT_SET(page_count, 0);
+	VMGCNT_SET(free_count, 0);
 	list = getenv("vm.blacklist");
 	for (i = 0; phys_avail[i + 1] != 0; i += 2) {
 		pa = phys_avail[i];
@@ -874,11 +874,11 @@
 
 loop:
 	mtx_lock(&vm_page_queue_free_mtx);
-	if (cnt.v_free_count > cnt.v_free_reserved ||
+	if (VMGCNT_GET(free_count) > VMGCNT_GET(free_reserved) ||
 	    (page_req == VM_ALLOC_SYSTEM && 
-	     cnt.v_cache_count == 0 && 
-	     cnt.v_free_count > cnt.v_interrupt_free_min) ||
-	    (page_req == VM_ALLOC_INTERRUPT && cnt.v_free_count > 0)) {
+	     VMGCNT_GET(cache_count) == 0 && 
+	     VMGCNT_GET(free_count) > VMGCNT_GET(interrupt_free_min)) ||
+	    (page_req == VM_ALLOC_INTERRUPT && VMGCNT_GET(free_count) > 0)) {
 		/*
 		 * Allocate from the free queue if the number of free pages
 		 * exceeds the minimum for the request class.
@@ -893,9 +893,9 @@
 		 */
 		vm_page_lock_queues();
 		if ((m = vm_page_select_cache(color)) == NULL) {
-			KASSERT(cnt.v_cache_count == 0,
+			KASSERT(VMGCNT_GET(cache_count) == 0,
 			    ("vm_page_alloc: cache queue is missing %d pages",
-			    cnt.v_cache_count));
+			    VMGCNT_GET(cache_count)));
 			vm_page_unlock_queues();
 			atomic_add_int(&vm_pageout_deficit, 1);
 			pagedaemon_wakeup();
@@ -904,7 +904,8 @@
 				return (NULL);
 
 			mtx_lock(&vm_page_queue_free_mtx);
-			if (cnt.v_free_count <= cnt.v_interrupt_free_min) {
+			if (VMGCNT_GET(free_count) <=
+			    VMGCNT_GET(interrupt_free_min)) {
 				mtx_unlock(&vm_page_queue_free_mtx);
 				return (NULL);
 			}
@@ -954,7 +955,7 @@
 	else
 		m->oflags = VPO_BUSY;
 	if (req & VM_ALLOC_WIRED) {
-		atomic_add_int(&cnt.v_wire_count, 1);
+		VMGCNT_ADD(wire_count, 1);
 		m->wire_count = 1;
 	} else
 		m->wire_count = 0;
@@ -1000,8 +1001,8 @@
 			vm_pages_needed = 1;
 			wakeup(&vm_pages_needed);
 		}
-		msleep(&cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | PVM,
-		    "vmwait", 0);
+		msleep(VMGCNT_PTR(free_count), &vm_page_queue_free_mtx, PDROP |
+		    PVM, "vmwait", 0);
 	}
 }
 
@@ -1024,7 +1025,7 @@
 		vm_pages_needed = 1;
 		wakeup(&vm_pages_needed);
 	}
-	msleep(&cnt.v_free_count, &vm_page_queue_free_mtx, PDROP | PUSER,
+	msleep(VMGCNT_PTR(free_count), &vm_page_queue_free_mtx, PDROP | PUSER,
 	    "pfault", 0);
 }
 
@@ -1045,7 +1046,7 @@
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
 	if (VM_PAGE_GETKNOWNQUEUE2(m) != PQ_ACTIVE) {
 		if (VM_PAGE_INQUEUE1(m, PQ_CACHE))
-			cnt.v_reactivated++;
+			VMGCNT_ADD(reactivated, 1);
 		vm_pageq_remove(m);
 		if (m->wire_count == 0 && (m->flags & PG_UNMANAGED) == 0) {
 			if (m->act_count < ACT_INIT)
@@ -1078,7 +1079,8 @@
 	 * some free.
 	 */
 	if (vm_pageout_pages_needed &&
-	    cnt.v_cache_count + cnt.v_free_count >= cnt.v_pageout_free_min) {
+	    VMGCNT_GET(cache_count) + VMGCNT_GET(free_count) >=
+	    VMGCNT_GET(pageout_free_min)) {
 		wakeup(&vm_pageout_pages_needed);
 		vm_pageout_pages_needed = 0;
 	}
@@ -1089,7 +1091,7 @@
 	 */
 	if (vm_pages_needed && !vm_page_count_min()) {
 		vm_pages_needed = 0;
-		wakeup(&cnt.v_free_count);
+		wakeup(VMGCNT_PTR(free_count));
 	}
 }
 
@@ -1112,7 +1114,7 @@
 		mtx_assert(&vm_page_queue_mtx, MA_OWNED);
 	KASSERT(!pmap_page_is_mapped(m),
 	    ("vm_page_free_toq: freeing mapped page %p", m));
-	cnt.v_tfree++;
+	VMGCNT_ADD(tfree, 1);
 
 	if (m->busy || VM_PAGE_INQUEUE1(m, PQ_FREE)) {
 		printf(
@@ -1203,7 +1205,7 @@
 	if (m->wire_count == 0) {
 		if ((m->flags & PG_UNMANAGED) == 0)
 			vm_pageq_remove(m);
-		atomic_add_int(&cnt.v_wire_count, 1);
+		VMGCNT_ADD(wire_count, 1);
 	}
 	m->wire_count++;
 	KASSERT(m->wire_count != 0, ("vm_page_wire: wire_count overflow m=%p", m));
@@ -1247,7 +1249,7 @@
 	if (m->wire_count > 0) {
 		m->wire_count--;
 		if (m->wire_count == 0) {
-			atomic_subtract_int(&cnt.v_wire_count, 1);
+			VMGCNT_DEC(wire_count, 1);
 			if (m->flags & PG_UNMANAGED) {
 				;
 			} else if (activate)
@@ -1286,7 +1288,7 @@
 		return;
 	if (m->wire_count == 0 && (m->flags & PG_UNMANAGED) == 0) {
 		if (VM_PAGE_INQUEUE1(m, PQ_CACHE))
-			cnt.v_reactivated++;
+			VMGCNT_ADD(reactivated, 1);
 		vm_page_flag_clear(m, PG_WINATCFLS);
 		vm_pageq_remove(m);
 		if (athead)
@@ -1295,7 +1297,7 @@
 			TAILQ_INSERT_TAIL(&vm_page_queues[PQ_INACTIVE].pl, m, pageq);
 		VM_PAGE_SETQUEUE2(m, PQ_INACTIVE);
 		vm_page_queues[PQ_INACTIVE].lcnt++;
-		cnt.v_inactive_count++;
+		VMGCNT_ADD(inactive_count, 1);
 	}
 }
 
@@ -1780,16 +1782,16 @@
 
 DB_SHOW_COMMAND(page, vm_page_print_page_info)
 {
-	db_printf("cnt.v_free_count: %d\n", cnt.v_free_count);
-	db_printf("cnt.v_cache_count: %d\n", cnt.v_cache_count);
-	db_printf("cnt.v_inactive_count: %d\n", cnt.v_inactive_count);
-	db_printf("cnt.v_active_count: %d\n", cnt.v_active_count);
-	db_printf("cnt.v_wire_count: %d\n", cnt.v_wire_count);
-	db_printf("cnt.v_free_reserved: %d\n", cnt.v_free_reserved);
-	db_printf("cnt.v_free_min: %d\n", cnt.v_free_min);
-	db_printf("cnt.v_free_target: %d\n", cnt.v_free_target);
-	db_printf("cnt.v_cache_min: %d\n", cnt.v_cache_min);
-	db_printf("cnt.v_inactive_target: %d\n", cnt.v_inactive_target);
+	db_printf("cnt.v_free_count: %d\n", VMGCNT_GET(free_count));
+	db_printf("cnt.v_cache_count: %d\n", VMGCNT_GET(cache_count));
+	db_printf("cnt.v_inactive_count: %d\n", VMGCNT_GET(inactive_count));
+	db_printf("cnt.v_active_count: %d\n", VMGCNT_GET(active_count));
+	db_printf("cnt.v_wire_count: %d\n", VMGCNT_GET(wire_count));
+	db_printf("cnt.v_free_reserved: %d\n", VMGCNT_GET(free_reserved));
+	db_printf("cnt.v_free_min: %d\n", VMGCNT_GET(free_min));
+	db_printf("cnt.v_free_target: %d\n", VMGCNT_GET(free_target));
+	db_printf("cnt.v_cache_min: %d\n", VMGCNT_GET(cache_min));
+	db_printf("cnt.v_inactive_target: %d\n", VMGCNT_GET(inactive_target));
 }
 
 DB_SHOW_COMMAND(pageq, vm_page_print_pageq_info)
--- /usr/src/sys/vm/vm_pageout.c	2007/02/07 06:41:32
+++ vm/vm_pageout.c	2007/05/10 22:48:38
@@ -538,7 +538,7 @@
 				goto unlock_return;
 			}
 			next = TAILQ_NEXT(p, listq);
-			cnt.v_pdpages++;
+			VMGCNT_ADD(pdpages, 1);
 			if (p->wire_count != 0 ||
 			    p->hold_count != 0 ||
 			    p->busy != 0 ||
@@ -739,13 +739,13 @@
 	vm_page_lock_queues();
 rescan0:
 	addl_page_shortage = addl_page_shortage_init;
-	maxscan = cnt.v_inactive_count;
+	maxscan = VMGCNT_GET(inactive_count);
 
 	for (m = TAILQ_FIRST(&vm_page_queues[PQ_INACTIVE].pl);
 	     m != NULL && maxscan-- > 0 && page_shortage > 0;
 	     m = next) {
 
-		cnt.v_pdpages++;
+		VMGCNT_ADD(pdpages, 1);
 
 		if (VM_PAGE_GETQUEUE(m) != PQ_INACTIVE) {
 			goto rescan0;
@@ -856,7 +856,7 @@
 			 * Invalid pages can be easily freed
 			 */
 			vm_page_free(m);
-			cnt.v_dfree++;
+			VMGCNT_ADD(dfree, 1);
 			--page_shortage;
 		} else if (m->dirty == 0) {
 			/*
@@ -1043,8 +1043,8 @@
 	 * Compute the number of pages we want to try to move from the
 	 * active queue to the inactive queue.
 	 */
-	page_shortage = vm_paging_target() +
-		cnt.v_inactive_target - cnt.v_inactive_count;
+	page_shortage = vm_paging_target() + VMGCNT_GET(inactive_target) -
+	    VMGCNT_GET(inactive_count);
 	page_shortage += addl_page_shortage;
 
 	/*
@@ -1052,7 +1052,7 @@
 	 * track the per-page activity counter and use it to locate
 	 * deactivation candidates.
 	 */
-	pcount = cnt.v_active_count;
+	pcount = VMGCNT_GET(active_count);
 	m = TAILQ_FIRST(&vm_page_queues[PQ_ACTIVE].pl);
 
 	while ((m != NULL) && (pcount-- > 0) && (page_shortage > 0)) {
@@ -1089,7 +1089,7 @@
 		 * The count for pagedaemon pages is done after checking the
 		 * page for eligibility...
 		 */
-		cnt.v_pdpages++;
+		VMGCNT_ADD(pdpages, 1);
 
 		/*
 		 * Check to see "how much" the page has been used.
@@ -1149,8 +1149,9 @@
 	 */
 	cache_cur = cache_last_free;
 	cache_first_failure = -1;
-	while (cnt.v_free_count < cnt.v_free_reserved && (cache_cur =
-	    (cache_cur + PQ_PRIME2) & PQ_COLORMASK) != cache_first_failure) {
+	while (VMGCNT_GET(free_count) < VMGCNT_GET(free_reserved) &&
+	    (cache_cur = (cache_cur + PQ_PRIME2) & PQ_COLORMASK) !=
+	    cache_first_failure) {
 		TAILQ_FOREACH(m, &vm_page_queues[PQ_CACHE + cache_cur].pl,
 		    pageq) {
 			KASSERT(m->dirty == 0,
@@ -1168,7 +1169,7 @@
 				    m));
 				vm_page_free(m);
 				VM_OBJECT_UNLOCK(object);
-				cnt.v_dfree++;
+				VMGCNT_ADD(dfree, 1);
 				cache_last_free = cache_cur;
 				cache_first_failure = -1;
 				break;
@@ -1291,7 +1292,7 @@
 			sched_nice(bigproc, PRIO_MIN);
 			mtx_unlock_spin(&sched_lock);
 			PROC_UNLOCK(bigproc);
-			wakeup(&cnt.v_free_count);
+			wakeup(VMGCNT_PTR(free_count));
 		}
 	}
 	mtx_unlock(&Giant);
@@ -1314,16 +1315,18 @@
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
 	page_shortage = 
-	    (cnt.v_inactive_target + cnt.v_cache_max + cnt.v_free_min) -
-	    (cnt.v_free_count + cnt.v_inactive_count + cnt.v_cache_count);
+	    (VMGCNT_GET(inactive_target) + VMGCNT_GET(cache_max) +
+	    VMGCNT_GET(free_min)) - (VMGCNT_GET(free_count) +
+	    VMGCNT_GET(inactive_count) + VMGCNT_GET(cache_count));
 
 	if (page_shortage <= 0)
 		return;
 
-	pcount = cnt.v_active_count;
+	pcount = VMGCNT_GET(active_count);
 	fullintervalcount += vm_pageout_stats_interval;
 	if (fullintervalcount < vm_pageout_full_stats_interval) {
-		tpcount = (vm_pageout_stats_max * cnt.v_active_count) / cnt.v_page_count;
+		tpcount = (vm_pageout_stats_max * VMGCNT_GET(active_count)) /
+		    VMGCNT_GET(page_count);
 		if (pcount > tpcount)
 			pcount = tpcount;
 	} else {
@@ -1409,8 +1412,8 @@
 	/*
 	 * Initialize some paging parameters.
 	 */
-	cnt.v_interrupt_free_min = 2;
-	if (cnt.v_page_count < 2000)
+	VMGCNT_SET(interrupt_free_min, 2);
+	if (VMGCNT_GET(page_count) < 2000)
 		vm_pageout_page_count = 8;
 
 	/*
@@ -1418,17 +1421,16 @@
 	 * swap pager structures plus enough for any pv_entry structs
 	 * when paging. 
 	 */
-	if (cnt.v_page_count > 1024)
-		cnt.v_free_min = 4 + (cnt.v_page_count - 1024) / 200;
-	else
-		cnt.v_free_min = 4;
-	cnt.v_pageout_free_min = (2*MAXBSIZE)/PAGE_SIZE +
-	    cnt.v_interrupt_free_min;
-	cnt.v_free_reserved = vm_pageout_page_count +
-	    cnt.v_pageout_free_min + (cnt.v_page_count / 768) + PQ_NUMCOLORS;
-	cnt.v_free_severe = cnt.v_free_min / 2;
-	cnt.v_free_min += cnt.v_free_reserved;
-	cnt.v_free_severe += cnt.v_free_reserved;
+	VMGCNT_SET(free_min, (VMGCNT_GET(page_count) > 1024) ? (4 +
+	    (VMGCNT_GET(page_count) - 1024) / 200) : 4);
+	VMGCNT_SET(pageout_free_min, (2 * MAXBSIZE) / PAGE_SIZE +
+	    VMGCNT_GET(interrupt_free_min));
+	VMGCNT_SET(free_reserved, vm_pageout_page_count +
+	    VMGCNT_GET(pageout_free_min) + (VMGCNT_GET(page_count) / 768) +
+	    PQ_NUMCOLORS);
+	VMGCNT_SET(free_severe, VMGCNT_GET(free_min) / 2);
+	VMGCNT_ADD(free_min, VMGCNT_GET(free_reserved));
+	VMGCNT_ADD(free_severe, VMGCNT_GET(free_reserved));
 
 	/*
 	 * v_free_target and v_cache_min control pageout hysteresis.  Note
@@ -1441,29 +1443,27 @@
 	 * be big enough to handle memory needs while the pageout daemon
 	 * is signalled and run to free more pages.
 	 */
-	if (cnt.v_free_count > 6144)
-		cnt.v_free_target = 4 * cnt.v_free_min + cnt.v_free_reserved;
-	else
-		cnt.v_free_target = 2 * cnt.v_free_min + cnt.v_free_reserved;
+	VMGCNT_SET(free_target, ((VMGCNT_GET(free_count) > 6144) ? 4 : 2) *
+	    VMGCNT_GET(free_min) + VMGCNT_GET(free_reserved));
 
-	if (cnt.v_free_count > 2048) {
-		cnt.v_cache_min = cnt.v_free_target;
-		cnt.v_cache_max = 2 * cnt.v_cache_min;
-		cnt.v_inactive_target = (3 * cnt.v_free_target) / 2;
+	if (VMGCNT_GET(free_count) > 2048) {
+		VMGCNT_SET(cache_min, VMGCNT_GET(free_target));
+		VMGCNT_SET(cache_max, 2 * VMGCNT_GET(cache_min));
+		VMGCNT_SET(inactive_target, (3 * VMGCNT_GET(free_target) / 2));
 	} else {
-		cnt.v_cache_min = 0;
-		cnt.v_cache_max = 0;
-		cnt.v_inactive_target = cnt.v_free_count / 4;
+		VMGCNT_SET(cache_min, 0);
+		VMGCNT_SET(cache_max, 0);
+		VMGCNT_SET(inactive_target, VMGCNT_GET(free_count) / 4);
 	}
-	if (cnt.v_inactive_target > cnt.v_free_count / 3)
-		cnt.v_inactive_target = cnt.v_free_count / 3;
+	if (VMGCNT_GET(inactive_target) > VMGCNT_GET(free_count) / 3)
+		VMGCNT_SET(inactive_target, VMGCNT_GET(free_count) / 3);
 
 	/* XXX does not really belong here */
 	if (vm_page_max_wired == 0)
-		vm_page_max_wired = cnt.v_free_count / 3;
+		vm_page_max_wired = VMGCNT_GET(free_count) / 3;
 
 	if (vm_pageout_stats_max == 0)
-		vm_pageout_stats_max = cnt.v_free_target;
+		vm_pageout_stats_max = VMGCNT_GET(free_target);
 
 	/*
 	 * Set interval in seconds for stats scan.
@@ -1489,7 +1489,7 @@
 		if (vm_pages_needed && !vm_page_count_min()) {
 			if (!vm_paging_needed())
 				vm_pages_needed = 0;
-			wakeup(&cnt.v_free_count);
+			wakeup(VMGCNT_PTR(free_count));
 		}
 		if (vm_pages_needed) {
 			/*
@@ -1524,7 +1524,7 @@
 			}
 		}
 		if (vm_pages_needed)
-			cnt.v_pdwakeups++;
+			VMGCNT_ADD(pdwakeups, 1);
 		mtx_unlock(&vm_page_queue_free_mtx);
 		vm_pageout_scan(pass);
 	}
--- /usr/src/sys/vm/vm_pageq.c	2007/02/05 06:07:04
+++ vm/vm_pageq.c	2007/05/10 19:52:44
@@ -140,14 +140,14 @@
 	vm_coloring_init();
 
 	for (i = 0; i < PQ_NUMCOLORS; ++i) {
-		vm_page_queues[PQ_FREE+i].cnt = &cnt.v_free_count;
+		vm_page_queues[PQ_FREE+i].cnt = VMGCNT_PTR(free_count);
 	}
 	for (i = 0; i < PQ_NUMCOLORS; ++i) {
-		vm_page_queues[PQ_CACHE + i].cnt = &cnt.v_cache_count;
+		vm_page_queues[PQ_CACHE + i].cnt = VMGCNT_PTR(cache_count);
 	}
-	vm_page_queues[PQ_INACTIVE].cnt = &cnt.v_inactive_count;
-	vm_page_queues[PQ_ACTIVE].cnt = &cnt.v_active_count;
-	vm_page_queues[PQ_HOLD].cnt = &cnt.v_active_count;
+	vm_page_queues[PQ_INACTIVE].cnt = VMGCNT_PTR(inactive_count);
+	vm_page_queues[PQ_ACTIVE].cnt = VMGCNT_PTR(active_count);
+	vm_page_queues[PQ_HOLD].cnt = VMGCNT_PTR(active_count);
 
 	for (i = 0; i < PQ_COUNT; i++) {
 		TAILQ_INIT(&vm_page_queues[i].pl);
@@ -192,7 +192,7 @@
 {
 	vm_page_t m;
 
-	atomic_add_int(&cnt.v_page_count, 1);
+	VMGCNT_ADD(page_count, 1);
 	m = PHYS_TO_VM_PAGE(pa);
 	m->phys_addr = pa;
 	m->flags = 0;
--- /usr/src/sys/vm/vm_zeroidle.c	2007/02/11 05:22:38
+++ vm/vm_zeroidle.c	2007/05/10 19:52:44
@@ -90,9 +90,10 @@
 	 * fast sleeps.  We also do not want to be continuously zeroing
 	 * pages because doing so may flush our L1 and L2 caches too much.
 	 */
-	if (zero_state && vm_page_zero_count >= ZIDLE_LO(cnt.v_free_count))
+	if (zero_state && vm_page_zero_count >=
+	    ZIDLE_LO(VMGCNT_GET(free_count)))
 		return (0);
-	if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
+	if (vm_page_zero_count >= ZIDLE_HI(VMGCNT_GET(free_count)))
 		return (0);
 	return (1);
 }
@@ -115,7 +116,7 @@
 		vm_pageq_enqueue(PQ_FREE + m->pc, m);
 		++vm_page_zero_count;
 		++cnt_prezero;
-		if (vm_page_zero_count >= ZIDLE_HI(cnt.v_free_count))
+		if (vm_page_zero_count >= ZIDLE_HI(VMGCNT_GET(free_count)))
 			zero_state = 1;
 	}
 	free_rover = (free_rover + PQ_PRIME2) & PQ_COLORMASK;
--- /usr/src/sys/vm/vnode_pager.c	2006/10/14 23:26:11
+++ vm/vnode_pager.c	2007/05/10 19:52:44
@@ -728,8 +728,8 @@
 			if (i != reqpage)
 				vm_page_free(m[i]);
 		vm_page_unlock_queues();
-		cnt.v_vnodein++;
-		cnt.v_vnodepgsin++;
+		VMGCNT_ADD(vnodein, 1);
+		VMGCNT_ADD(vnodepgsin, 1);
 		error = vnode_pager_input_old(object, m[reqpage]);
 		VM_OBJECT_UNLOCK(object);
 		return (error);
@@ -757,8 +757,8 @@
 				vm_page_free(m[i]);
 		vm_page_unlock_queues();
 		VM_OBJECT_UNLOCK(object);
-		cnt.v_vnodein++;
-		cnt.v_vnodepgsin++;
+		VMGCNT_ADD(vnodein, 1);
+		VMGCNT_ADD(vnodepgsin, 1);
 		return vnode_pager_input_smlfs(object, m[reqpage]);
 	}
 
@@ -909,8 +909,8 @@
 	bp->b_runningbufspace = bp->b_bufsize;
 	atomic_add_int(&runningbufspace, bp->b_runningbufspace);
 
-	cnt.v_vnodein++;
-	cnt.v_vnodepgsin += count;
+	VMGCNT_ADD(vnodein, 1);
+	VMGCNT_ADD(vnodepgsin, 1);
 
 	/* do the input */
 	bp->b_iooffset = dbtob(bp->b_blkno);
@@ -1031,7 +1031,8 @@
 	 * daemon up.  This should be probably be addressed XXX.
 	 */
 
-	if ((cnt.v_free_count + cnt.v_cache_count) < cnt.v_pageout_free_min)
+	if ((VMGCNT_GET(free_count) + VMGCNT_GET(cache_count)) <
+	    VMGCNT_GET(pageout_free_min))
 		sync |= OBJPC_SYNC;
 
 	/*
@@ -1157,8 +1158,8 @@
 	auio.uio_resid = maxsize;
 	auio.uio_td = (struct thread *) 0;
 	error = VOP_WRITE(vp, &auio, ioflags, curthread->td_ucred);
-	cnt.v_vnodeout++;
-	cnt.v_vnodepgsout += ncount;
+	VMGCNT_ADD(vnodein, 1);
+	VMGCNT_ADD(vnodepgsin, ncount);
 
 	if (error) {
 		if ((ppscheck = ppsratecheck(&lastfail, &curfail, 1)))
