git: aea9dba46b81 - main - turnstile: Mention the lock name when panicking due to a sleeping thread

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Sat, 10 Aug 2024 15:50:30 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=aea9dba46b81abc5c0fd4c42d3ac762d3bc1de37

commit aea9dba46b81abc5c0fd4c42d3ac762d3bc1de37
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-08-10 15:42:35 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-08-10 15:42:35 +0000

    turnstile: Mention the lock name when panicking due to a sleeping thread
    
    This will hopefully make it a bit easier to track down the cause of such
    panics.
    
    MFC after:      2 weeks
---
 sys/kern/subr_turnstile.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/kern/subr_turnstile.c b/sys/kern/subr_turnstile.c
index 0a20f3163e30..544dd9f52e9c 100644
--- a/sys/kern/subr_turnstile.c
+++ b/sys/kern/subr_turnstile.c
@@ -246,7 +246,8 @@ propagate_priority(struct thread *td)
 		"Sleeping thread (tid %d, pid %d) owns a non-sleepable lock\n",
 			    td->td_tid, td->td_proc->p_pid);
 			kdb_backtrace_thread(td);
-			panic("sleeping thread");
+			panic("sleeping thread holds %s",
+			    ts->ts_lockobj->lo_name);
 		}
 
 		/*