Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jan 2011 22:45:22 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217171 - head/sys/vm
Message-ID:  <201101082245.p08MjMKP017391@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <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_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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101082245.p08MjMKP017391>