Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Nov 2017 20:49:27 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326200 - head/sys/kern
Message-ID:  <201711252049.vAPKnRaA026691@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Sat Nov 25 20:49:27 2017
New Revision: 326200
URL: https://svnweb.freebsd.org/changeset/base/326200

Log:
  Add the missing lockstat check for thread lock.

Modified:
  head/sys/kern/kern_mutex.c

Modified: head/sys/kern/kern_mutex.c
==============================================================================
--- head/sys/kern/kern_mutex.c	Sat Nov 25 20:37:13 2017	(r326199)
+++ head/sys/kern/kern_mutex.c	Sat Nov 25 20:49:27 2017	(r326200)
@@ -834,6 +834,8 @@ _thread_lock(struct thread *td)
 
 	tid = (uintptr_t)curthread;
 
+	if (__predict_false(LOCKSTAT_PROFILE_ENABLED(spin__acquire)))
+		goto slowpath_noirq;
 	spinlock_enter();
 	m = td->td_lock;
 	thread_lock_validate(m, 0, file, line);
@@ -855,7 +857,12 @@ _thread_lock(struct thread *td)
 		_mtx_release_lock_quick(m);
 slowpath_unlocked:
 	spinlock_exit();
+slowpath_noirq:
+#if LOCK_DEBUG > 0
+	thread_lock_flags_(td, opts, file, line);
+#else
 	thread_lock_flags_(td, 0, 0, 0);
+#endif
 }
 #endif
 



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