From owner-p4-projects@FreeBSD.ORG Sun Mar 15 08:24:15 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8416B106566C; Sun, 15 Mar 2009 08:24:14 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 298FD1065674 for ; Sun, 15 Mar 2009 08:24:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 174DD8FC0C for ; Sun, 15 Mar 2009 08:24:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n2F8ODdd066219 for ; Sun, 15 Mar 2009 08:24:13 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n2F8OD4F066217 for perforce@freebsd.org; Sun, 15 Mar 2009 08:24:13 GMT (envelope-from julian@freebsd.org) Date: Sun, 15 Mar 2009 08:24:13 GMT Message-Id: <200903150824.n2F8OD4F066217@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Cc: Subject: PERFORCE change 159237 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Mar 2009 08:24:15 -0000 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 -__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 #include @@ -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 -__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 -__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 -__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 #include @@ -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;