svn commit: r193695 - user/kmacy/releng_7_2_fcs/sys/kern

Kip Macy kmacy at FreeBSD.org
Mon Jun 8 08:16:43 UTC 2009


Author: kmacy
Date: Mon Jun  8 08:16:42 2009
New Revision: 193695
URL: http://svn.freebsd.org/changeset/base/193695

Log:
  reduce coherence overhead of lock profiling when not in use

Modified:
  user/kmacy/releng_7_2_fcs/sys/kern/subr_lock.c

Modified: user/kmacy/releng_7_2_fcs/sys/kern/subr_lock.c
==============================================================================
--- user/kmacy/releng_7_2_fcs/sys/kern/subr_lock.c	Mon Jun  8 08:10:52 2009	(r193694)
+++ user/kmacy/releng_7_2_fcs/sys/kern/subr_lock.c	Mon Jun  8 08:16:42 2009	(r193695)
@@ -184,12 +184,12 @@ struct lock_prof_type {
 
 struct lock_prof_cpu {
 	struct lock_prof_type	lpc_types[2]; /* One for spin one for other. */
-};
+} __aligned(128);
 
 struct lock_prof_cpu *lp_cpu[MAXCPU];
 
-volatile int lock_prof_enable = 0;
-static volatile int lock_prof_resetting;
+volatile int lock_prof_enable __aligned(64);
+static volatile int lock_prof_resetting __aligned(64);
 
 /* SWAG: sbuf size = avg stat. line size * number of locks */
 #define LPROF_SBUF_SIZE		256 * 400
@@ -233,6 +233,7 @@ lock_prof_init(void *arg)
 {
 	int cpu;
 
+	lock_prof_enable = 1;
 	for (cpu = 0; cpu <= mp_maxid; cpu++) {
 		lp_cpu[cpu] = malloc(sizeof(*lp_cpu[cpu]), M_DEVBUF,
 		    M_WAITOK | M_ZERO);


More information about the svn-src-user mailing list