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
This commit is contained in:
Mark Johnston 2015-07-19 22:26:02 +00:00
parent 1b79b9498b
commit 97cc6870f6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285706

View File

@ -382,9 +382,6 @@ __rw_rlock(volatile uintptr_t *c, const char *file, int line)
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 char *file, int line)
}
continue;
}
#ifdef KDTRACE_HOOKS
spin_cnt++;
#endif
#ifdef HWPMC_HOOKS
PMC_SOFT_CALL( , , lock, failed);
#endif