From owner-svn-src-head@freebsd.org Sat Feb 18 01:52:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F02C7CE43B5; Sat, 18 Feb 2017 01:52:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAB7325C; Sat, 18 Feb 2017 01:52:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1I1qAFY030863; Sat, 18 Feb 2017 01:52:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1I1qASK030860; Sat, 18 Feb 2017 01:52:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201702180152.v1I1qASK030860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 18 Feb 2017 01:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313908 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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, 18 Feb 2017 01:52:12 -0000 Author: mjg Date: Sat Feb 18 01:52:10 2017 New Revision: 313908 URL: https://svnweb.freebsd.org/changeset/base/313908 Log: mtx: plug the 'opts' argument when not used Modified: head/sys/kern/kern_mutex.c head/sys/sys/lock.h head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Feb 18 00:08:13 2017 (r313907) +++ head/sys/kern/kern_mutex.c Sat Feb 18 01:52:10 2017 (r313908) @@ -429,7 +429,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, const char *file, int line) #else void -__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, int opts) +__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid) #endif { struct mtx *m; @@ -471,14 +471,18 @@ __mtx_lock_sleep(volatile uintptr_t *c, (opts & MTX_RECURSE) != 0, ("_mtx_lock_sleep: recursed on non-recursive mutex %s @ %s:%d\n", m->lock_object.lo_name, file, line)); +#if LOCK_DEBUG > 0 opts &= ~MTX_RECURSE; +#endif m->mtx_recurse++; atomic_set_ptr(&m->mtx_lock, MTX_RECURSED); if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_sleep: %p recursing", m); return; } +#if LOCK_DEBUG > 0 opts &= ~MTX_RECURSE; +#endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -873,7 +877,7 @@ void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line) #else void -__mtx_unlock_sleep(volatile uintptr_t *c, int opts) +__mtx_unlock_sleep(volatile uintptr_t *c) #endif { struct mtx *m; Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Sat Feb 18 00:08:13 2017 (r313907) +++ head/sys/sys/lock.h Sat Feb 18 01:52:10 2017 (r313908) @@ -154,8 +154,13 @@ struct lock_class { * file - file name * line - line number */ +#if LOCK_DEBUG > 0 #define LOCK_LOG_TEST(lo, flags) \ (((flags) & LOP_QUIET) == 0 && ((lo)->lo_flags & LO_QUIET) == 0) +#else +#define LOCK_LOG_TEST(lo, flags) 0 +#endif + #define LOCK_LOG_LOCK(opname, lo, flags, recurse, file, line) do { \ if (LOCK_LOG_TEST((lo), (flags))) \ Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sat Feb 18 00:08:13 2017 (r313907) +++ head/sys/sys/mutex.h Sat Feb 18 01:52:10 2017 (r313908) @@ -104,9 +104,8 @@ void __mtx_lock_sleep(volatile uintptr_t void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line); #else -void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, - int opts); -void __mtx_unlock_sleep(volatile uintptr_t *c, int opts); +void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, uintptr_t tid); +void __mtx_unlock_sleep(volatile uintptr_t *c); #endif #ifdef SMP @@ -154,9 +153,9 @@ void thread_lock_flags_(struct thread *, __mtx_unlock_sleep(&(m)->mtx_lock, o, f, l) #else #define _mtx_lock_sleep(m, v, t, o, f, l) \ - __mtx_lock_sleep(&(m)->mtx_lock, v, t, o) + __mtx_lock_sleep(&(m)->mtx_lock, v, t) #define _mtx_unlock_sleep(m, o, f, l) \ - __mtx_unlock_sleep(&(m)->mtx_lock, o) + __mtx_unlock_sleep(&(m)->mtx_lock) #endif #ifdef SMP #define _mtx_lock_spin(m, v, t, o, f, l) \