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:
parent
1b79b9498b
commit
97cc6870f6
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user