mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285706
@ -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…
Reference in New Issue
Block a user