diff options
author | alc <alc@FreeBSD.org> | 2011-01-08 22:45:22 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2011-01-08 22:45:22 +0000 |
commit | a3f4c0274db19c40a1aa1e7cfa5a914ba189f866 (patch) | |
tree | a6c9f223068f91b184fceed1c686593f29653de3 | |
parent | 26e5735cfb7105da5b9a155235e1fa3fde0ba7a7 (diff) | |
download | FreeBSD-src-a3f4c0274db19c40a1aa1e7cfa5a914ba189f866.zip FreeBSD-src-a3f4c0274db19c40a1aa1e7cfa5a914ba189f866.tar.gz |
Eliminate the counting of vm_page_pa_tryrelock calls. We really don't
need it anymore. Moreover, its implementation had a type mismatch, a
long is not necessarily an uint64_t. (This mismatch was hidden by
casting.) Move the remaining two counters up a level in the sysctl
hierarchy. There is no reason for them to be under the vm.pmap node.
Reviewed by: kib
-rw-r--r-- | sys/vm/vm_page.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index c11b024..3d14c3b 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -132,24 +132,6 @@ __FBSDID("$FreeBSD$"); #include <machine/md_var.h> -#if defined(__amd64__) || defined (__i386__) -extern struct sysctl_oid_list sysctl__vm_pmap_children; -#else -SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); -#endif - -static uint64_t pmap_tryrelock_calls; -SYSCTL_QUAD(_vm_pmap, OID_AUTO, tryrelock_calls, CTLFLAG_RD, - &pmap_tryrelock_calls, 0, "Number of tryrelock calls"); - -static int pmap_tryrelock_restart; -SYSCTL_INT(_vm_pmap, OID_AUTO, tryrelock_restart, CTLFLAG_RD, - &pmap_tryrelock_restart, 0, "Number of tryrelock restarts"); - -static int pmap_tryrelock_race; -SYSCTL_INT(_vm_pmap, OID_AUTO, tryrelock_race, CTLFLAG_RD, - &pmap_tryrelock_race, 0, "Number of tryrelock pmap race cases"); - /* * Associated with page of user-allocatable memory is a * page structure. @@ -171,6 +153,14 @@ TUNABLE_INT("vm.boot_pages", &boot_pages); SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RD, &boot_pages, 0, "number of pages allocated for bootstrapping the VM system"); +static int pa_tryrelock_race; +SYSCTL_INT(_vm, OID_AUTO, tryrelock_race, CTLFLAG_RD, + &pa_tryrelock_race, 0, "Number of tryrelock race cases"); + +static int pa_tryrelock_restart; +SYSCTL_INT(_vm, OID_AUTO, tryrelock_restart, CTLFLAG_RD, + &pa_tryrelock_restart, 0, "Number of tryrelock restarts"); + static void vm_page_clear_dirty_mask(vm_page_t m, int pagebits); static void vm_page_queue_remove(int queue, vm_page_t m); static void vm_page_enqueue(int queue, vm_page_t m); @@ -195,7 +185,6 @@ vm_page_pa_tryrelock(pmap_t pmap, vm_paddr_t pa, vm_paddr_t *locked) uint32_t gen_count; gen_count = pmap->pm_gen_count; - atomic_add_long((volatile long *)&pmap_tryrelock_calls, 1); lockpa = *locked; *locked = pa; if (lockpa) { @@ -207,13 +196,13 @@ vm_page_pa_tryrelock(pmap_t pmap, vm_paddr_t pa, vm_paddr_t *locked) if (PA_TRYLOCK(pa)) return (0); PMAP_UNLOCK(pmap); - atomic_add_int((volatile int *)&pmap_tryrelock_restart, 1); + atomic_add_int(&pa_tryrelock_restart, 1); PA_LOCK(pa); PMAP_LOCK(pmap); if (pmap->pm_gen_count != gen_count + 1) { pmap->pm_retries++; - atomic_add_int((volatile int *)&pmap_tryrelock_race, 1); + atomic_add_int(&pa_tryrelock_race, 1); return (EAGAIN); } return (0); |