svn commit: r285706 - head/sys/kern
Mark Johnston
markj at FreeBSD.org
Sun Jul 19 22:26:03 UTC 2015
Author: markj
Date: Sun Jul 19 22:26:02 2015
New Revision: 285706
URL: https://svnweb.freebsd.org/changeset/base/285706
Log:
Don't increment the spin count until after the first attempt to acquire a
rwlock read lock. Otherwise the lockstat:::rw-spin probe will fire
spuriously.
MFC after: 1 week
Modified:
head/sys/kern/kern_rwlock.c
Modified: head/sys/kern/kern_rwlock.c
==============================================================================
--- head/sys/kern/kern_rwlock.c Sun Jul 19 22:25:16 2015 (r285705)
+++ head/sys/kern/kern_rwlock.c Sun Jul 19 22:26:02 2015 (r285706)
@@ -382,9 +382,6 @@ __rw_rlock(volatile uintptr_t *c, const
state = rw->rw_lock;
#endif
for (;;) {
-#ifdef KDTRACE_HOOKS
- spin_cnt++;
-#endif
/*
* Handle the easy case. If no other thread has a write
* lock, then try to bump up the count of read locks. Note
@@ -413,6 +410,9 @@ __rw_rlock(volatile uintptr_t *c, const
}
continue;
}
+#ifdef KDTRACE_HOOKS
+ spin_cnt++;
+#endif
#ifdef HWPMC_HOOKS
PMC_SOFT_CALL( , , lock, failed);
#endif
More information about the svn-src-all
mailing list