From owner-svn-src-head@FreeBSD.ORG Sat Jan 8 22:45:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3410C1065693; Sat, 8 Jan 2011 22:45:23 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0929A8FC19; Sat, 8 Jan 2011 22:45:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p08MjMTc017393; Sat, 8 Jan 2011 22:45:22 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p08MjMKP017391; Sat, 8 Jan 2011 22:45:22 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101082245.p08MjMKP017391@svn.freebsd.org> From: Alan Cox Date: Sat, 8 Jan 2011 22:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217171 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 22:45:23 -0000 Author: alc Date: Sat Jan 8 22:45:22 2011 New Revision: 217171 URL: http://svn.freebsd.org/changeset/base/217171 Log: 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 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Jan 8 22:42:56 2011 (r217170) +++ head/sys/vm/vm_page.c Sat Jan 8 22:45:22 2011 (r217171) @@ -132,24 +132,6 @@ __FBSDID("$FreeBSD$"); #include -#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_pad 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_pad 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);