svn commit: r300106 - in head/sys: conf kern

Mark Johnston markj at FreeBSD.org
Wed May 18 03:34:03 UTC 2016


Author: markj
Date: Wed May 18 03:34:02 2016
New Revision: 300106
URL: https://svnweb.freebsd.org/changeset/base/300106

Log:
  Remove the MUTEX_DEBUG kernel option.
  
  It has no counterpart among the other lock primitives and has been a
  no-op for years. Mutex consistency checks are generally done whenver
  INVARIANTS is enabled.

Modified:
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/kern/kern_mutex.c

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Wed May 18 03:28:51 2016	(r300105)
+++ head/sys/conf/NOTES	Wed May 18 03:34:02 2016	(r300106)
@@ -298,7 +298,6 @@ options 	SX_NOINLINE
 #	  performance and increase the frequency of kernel panics by
 #	  design.  If you aren't sure that you need it then you don't.
 #	  Relies on the PREEMPTION option.  DON'T TURN THIS ON.
-# MUTEX_DEBUG enables various extra assertions in the mutex code.
 # SLEEPQUEUE_PROFILING enables rudimentary profiling of the hash table
 #	  used to hold active sleep queues as well as sleep wait message
 #	  frequency.
@@ -314,7 +313,6 @@ options 	SX_NOINLINE
 # WITNESS_SKIPSPIN disables the witness checks on spin mutexes.
 options 	PREEMPTION
 options 	FULL_PREEMPTION
-options 	MUTEX_DEBUG
 options 	WITNESS
 options 	WITNESS_KDB
 options 	WITNESS_SKIPSPIN

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Wed May 18 03:28:51 2016	(r300105)
+++ head/sys/conf/options	Wed May 18 03:34:02 2016	(r300106)
@@ -590,7 +590,6 @@ MAXCPU			opt_global.h
 MAXMEMDOM		opt_global.h
 MAXPHYS			opt_global.h
 MCLSHIFT		opt_global.h
-MUTEX_DEBUG		opt_global.h
 MUTEX_NOINLINE		opt_global.h
 LOCK_PROFILING		opt_global.h
 LOCK_PROFILING_FAST	opt_global.h

Modified: head/sys/kern/kern_mutex.c
==============================================================================
--- head/sys/kern/kern_mutex.c	Wed May 18 03:28:51 2016	(r300105)
+++ head/sys/kern/kern_mutex.c	Wed May 18 03:34:02 2016	(r300106)
@@ -845,37 +845,6 @@ __mtx_assert(const volatile uintptr_t *c
 #endif
 
 /*
- * The MUTEX_DEBUG-enabled mtx_validate()
- *
- * Most of these checks have been moved off into the LO_INITIALIZED flag
- * maintained by the witness code.
- */
-#ifdef MUTEX_DEBUG
-
-void	mtx_validate(struct mtx *);
-
-void
-mtx_validate(struct mtx *m)
-{
-
-/*
- * XXX: When kernacc() does not require Giant we can reenable this check
- */
-#ifdef notyet
-	/*
-	 * Can't call kernacc() from early init386(), especially when
-	 * initializing Giant mutex, because some stuff in kernacc()
-	 * requires Giant itself.
-	 */
-	if (!cold)
-		if (!kernacc((caddr_t)m, sizeof(m),
-		    VM_PROT_READ | VM_PROT_WRITE))
-			panic("Can't read and write to mutex %p", m);
-#endif
-}
-#endif
-
-/*
  * General init routine used by the MTX_SYSINIT() macro.
  */
 void
@@ -908,11 +877,6 @@ _mtx_init(volatile uintptr_t *c, const c
 	    ("%s: mtx_lock not aligned for %s: %p", __func__, name,
 	    &m->mtx_lock));
 
-#ifdef MUTEX_DEBUG
-	/* Diagnostic and error correction */
-	mtx_validate(m);
-#endif
-
 	/* Determine lock class and lock flags. */
 	if (opts & MTX_SPIN)
 		class = &lock_class_mtx_spin;


More information about the svn-src-head mailing list