git: 1c8d1f51302e - stable/14 - turnstile: Mention the lock name when panicking due to a sleeping thread

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 03 Sep 2024 14:54:58 UTC
The branch stable/14 has been updated by markj:

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

commit 1c8d1f51302e1c6a177240936384245da3b859f7
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-08-10 15:42:35 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-09-03 14:54:42 +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
    
    (cherry picked from commit aea9dba46b81abc5c0fd4c42d3ac762d3bc1de37)
---
 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);
 		}
 
 		/*