mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-25 16:13:17 +00:00
If a spin lock is held for too long and WITNESS is enabled, then call
witness_display_spinlock() to see if we can find out where the current owner of the spin lock last acquired the lock.
This commit is contained in:
parent
1beccae67c
commit
4110951861
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118272
@ -690,12 +690,18 @@ _mtx_lock_spin(struct mtx *m, int opts, const char *file, int line)
|
||||
if (i < 60000000)
|
||||
DELAY(1);
|
||||
#ifdef DDB
|
||||
else if (!db_active)
|
||||
else if (!db_active) {
|
||||
#else
|
||||
else
|
||||
else {
|
||||
#endif
|
||||
panic("spin lock %s held by %p for > 5 seconds",
|
||||
printf("spin lock %s held by %p for > 5 seconds\n",
|
||||
m->mtx_object.lo_name, (void *)m->mtx_lock);
|
||||
#ifdef WITNESS
|
||||
witness_display_spinlock(&m->mtx_object,
|
||||
mtx_owner(m));
|
||||
#endif
|
||||
panic("spin lock held too long");
|
||||
}
|
||||
#ifdef __i386__
|
||||
ia32_pause();
|
||||
#endif
|
||||
|
@ -690,12 +690,18 @@ _mtx_lock_spin(struct mtx *m, int opts, const char *file, int line)
|
||||
if (i < 60000000)
|
||||
DELAY(1);
|
||||
#ifdef DDB
|
||||
else if (!db_active)
|
||||
else if (!db_active) {
|
||||
#else
|
||||
else
|
||||
else {
|
||||
#endif
|
||||
panic("spin lock %s held by %p for > 5 seconds",
|
||||
printf("spin lock %s held by %p for > 5 seconds\n",
|
||||
m->mtx_object.lo_name, (void *)m->mtx_lock);
|
||||
#ifdef WITNESS
|
||||
witness_display_spinlock(&m->mtx_object,
|
||||
mtx_owner(m));
|
||||
#endif
|
||||
panic("spin lock held too long");
|
||||
}
|
||||
#ifdef __i386__
|
||||
ia32_pause();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user