svn commit: r300103 - head/sys/kern

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


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

Log:
  lockstat:::thread-spin should only fire after spinning for the lock.
  
  MFC after:	1 week

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==============================================================================
--- head/sys/kern/kern_mutex.c	Wed May 18 03:19:53 2016	(r300102)
+++ head/sys/kern/kern_mutex.c	Wed May 18 03:21:21 2016	(r300103)
@@ -714,7 +714,8 @@ retry:
 	LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file,
 	    line);
 	WITNESS_LOCK(&m->lock_object, opts | LOP_EXCLUSIVE, file, line);
-	LOCKSTAT_RECORD1(thread__spin, m, spin_time);
+	if (spin_time != 0)
+		LOCKSTAT_RECORD1(thread__spin, m, spin_time);
 }
 
 struct mtx *


More information about the svn-src-head mailing list