diff options
author | John Baldwin <jhb@FreeBSD.org> | 2003-07-31 18:52:18 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2003-07-31 18:52:18 +0000 |
commit | 4110951861240e8f3ca037212e34fba134c3e3e0 (patch) | |
tree | cd0692f501cb693c05cedb58349db6285dec2068 /sys/kern/subr_turnstile.c | |
parent | 1beccae67c75ac5f03c4df06fec2b700d7ee4587 (diff) | |
download | src-4110951861240e8f3ca037212e34fba134c3e3e0.tar.gz src-4110951861240e8f3ca037212e34fba134c3e3e0.zip |
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.
Notes
Notes:
svn path=/head/; revision=118272
Diffstat (limited to 'sys/kern/subr_turnstile.c')
-rw-r--r-- | sys/kern/subr_turnstile.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c index bf157eb240f3..bbfac1b11cfd 100644 --- a/sys/kern/subr_turnstile.c +++ b/sys/kern/subr_turnstile.c @@ -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 |