Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Mar 2009 08:24:13 GMT
From:      Julian Elischer <julian@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 159237 for review
Message-ID:  <200903150824.n2F8OD4F066217@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=159237

Change 159237 by julian@julian_trafmon1 on 2009/03/15 08:23:28

	pretty please let GENERIC compile?

Affected files ...

.. //depot/projects/vimage/src/sys/kern/kern_lock.c#15 integrate
.. //depot/projects/vimage/src/sys/kern/kern_mutex.c#14 integrate
.. //depot/projects/vimage/src/sys/kern/kern_rwlock.c#16 integrate
.. //depot/projects/vimage/src/sys/kern/kern_sx.c#15 integrate

Differences ...

==== //depot/projects/vimage/src/sys/kern/kern_lock.c#15 (text+ko) ====

@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_lock.c,v 1.139 2009/03/14 11:43:02 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_lock.c,v 1.140 2009/03/15 08:03:54 jeff Exp $");
 
 #include <sys/param.h>
 #include <sys/ktr.h>
@@ -333,16 +333,17 @@
     const char *wmesg, int pri, int timo, const char *file, int line)
 {
 	GIANT_DECLARE;
-	uint64_t waittime;
 	struct lock_class *class;
 	const char *iwmesg;
 	uintptr_t tid, v, x;
 	u_int op;
-	int contested, error, ipri, itimo, queue, wakeup_swapper;
+	int error, ipri, itimo, queue, wakeup_swapper;
+#ifdef LOCK_PROFILING
+	uint64_t waittime = 0;
+	int contested = 0;
+#endif
 
-	contested = 0;
 	error = 0;
-	waittime = 0;
 	tid = (uintptr_t)curthread;
 	op = (flags & LK_TYPE_MASK);
 	iwmesg = (wmesg == LK_WMESG_DEFAULT) ? lk->lock_object.lo_name : wmesg;

==== //depot/projects/vimage/src/sys/kern/kern_mutex.c#14 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_mutex.c,v 1.208 2009/03/14 11:43:38 jeff Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_mutex.c,v 1.209 2009/03/15 08:03:54 jeff Exp $");
 
 #include "opt_adaptive_mutexes.h"
 #include "opt_ddb.h"
@@ -254,8 +254,11 @@
 int
 _mtx_trylock(struct mtx *m, int opts, const char *file, int line)
 {
-	int rval, contested = 0;
+#ifdef LOCK_PROFILING
 	uint64_t waittime = 0;
+	int contested = 0;
+#endif
+	int rval;
 
 	MPASS(curthread != NULL);
 	KASSERT(m->mtx_lock != MTX_DESTROYED,
@@ -296,15 +299,17 @@
     int line)
 {
 	struct turnstile *ts;
+	uintptr_t v;
 #ifdef ADAPTIVE_MUTEXES
 	volatile struct thread *owner;
 #endif
 #ifdef KTR
 	int cont_logged = 0;
 #endif
+#ifdef LOCK_PROFILING
 	int contested = 0;
 	uint64_t waittime = 0;
-	uintptr_t v;
+#endif
 
 	if (mtx_owned(m)) {
 		KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0,
@@ -448,8 +453,11 @@
 _mtx_lock_spin(struct mtx *m, uintptr_t tid, int opts, const char *file,
     int line)
 {
-	int i = 0, contested = 0;
+	int i = 0;
+#ifdef LOCK_PROFILING
+	int contested = 0;
 	uint64_t waittime = 0;
+#endif
 
 	if (LOCK_LOG_TEST(&m->lock_object, opts))
 		CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m);
@@ -486,11 +494,13 @@
 {
 	struct mtx *m;
 	uintptr_t tid;
-	int i, contested;
-	uint64_t waittime;
+	int i;
+#ifdef LOCK_PROFILING
+	int contested = 0;
+	uint64_t waittime = 0;
+#endif
 
-	contested = i = 0;
-	waittime = 0;
+	i = 0;
 	tid = (uintptr_t)curthread;
 	for (;;) {
 retry:

==== //depot/projects/vimage/src/sys/kern/kern_rwlock.c#16 (text+ko) ====

@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_rwlock.c,v 1.43 2009/02/26 15:51:54 ed Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_rwlock.c,v 1.44 2009/03/15 08:03:54 jeff Exp $");
 
 #include "opt_ddb.h"
 #include "opt_no_adaptive_rwlocks.h"
@@ -282,8 +282,10 @@
 	int spintries = 0;
 	int i;
 #endif
+#ifdef LOCK_PROFILING
 	uint64_t waittime = 0;
 	int contested = 0;
+#endif
 	uintptr_t v;
 
 	KASSERT(rw->rw_lock != RW_DESTROYED,
@@ -584,9 +586,11 @@
 	int spintries = 0;
 	int i;
 #endif
+	uintptr_t v, x;
+#ifdef LOCK_PROFILING
 	uint64_t waittime = 0;
-	uintptr_t v, x;
 	int contested = 0;
+#endif
 
 	if (rw_wlocked(rw)) {
 		KASSERT(rw->lock_object.lo_flags & RW_RECURSE,

==== //depot/projects/vimage/src/sys/kern/kern_sx.c#15 (text+ko) ====

@@ -40,7 +40,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_sx.c,v 1.62 2008/09/10 19:13:30 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_sx.c,v 1.63 2009/03/15 08:03:54 jeff Exp $");
 
 #include <sys/param.h>
 #include <sys/ktr.h>
@@ -431,9 +431,12 @@
 #ifdef ADAPTIVE_SX
 	volatile struct thread *owner;
 #endif
+	uintptr_t x;
+#ifdef LOCK_PROFILING
 	uint64_t waittime = 0;
-	uintptr_t x;
-	int contested = 0, error = 0;
+	int contested = 0;
+#endif
+	int error = 0;
 
 	/* If we already hold an exclusive lock, then recurse. */
 	if (sx_xlocked(sx)) {
@@ -652,8 +655,10 @@
 #ifdef ADAPTIVE_SX
 	volatile struct thread *owner;
 #endif
+#ifdef LOCK_PROFILING
 	uint64_t waittime = 0;
 	int contested = 0;
+#endif
 	uintptr_t x;
 	int error = 0;
 



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