git: 7a7a7cd85090 - stable/14 - mtx: Make idle thread assertions more robust
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 29 Apr 2025 18:30:43 UTC
The branch stable/14 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=7a7a7cd85090784070de36771e0ceae9427cc092
commit 7a7a7cd85090784070de36771e0ceae9427cc092
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-03-12 14:25:13 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-04-29 14:43:42 +0000
mtx: Make idle thread assertions more robust
Just print the pointer to the mutex instead of the name in case the
mutex is corrupted.
Reviewed by: olce, kib
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D49314
(cherry picked from commit 0ed104978ce55ecacf42bde4458acda0cc773940)
---
sys/kern/kern_mutex.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 11ff7e1cacc4..9bb059f13d64 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -266,8 +266,8 @@ __mtx_lock_flags(volatile uintptr_t *c, int opts, const char *file, int line)
KASSERT(kdb_active != 0 || SCHEDULER_STOPPED() ||
!TD_IS_IDLETHREAD(curthread),
- ("mtx_lock() by idle thread %p on sleep mutex %s @ %s:%d",
- curthread, m->lock_object.lo_name, file, line));
+ ("mtx_lock() by idle thread %p on mutex %p @ %s:%d",
+ curthread, m, file, line));
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_lock() of destroyed mutex @ %s:%d", file, line));
KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_spin,
@@ -428,8 +428,8 @@ _mtx_trylock_flags_int(struct mtx *m, int opts LOCK_FILE_LINE_ARG_DEF)
return (1);
KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(td),
- ("mtx_trylock() by idle thread %p on sleep mutex %s @ %s:%d",
- curthread, m->lock_object.lo_name, file, line));
+ ("mtx_trylock() by idle thread %p on mutex %p @ %s:%d",
+ curthread, m, file, line));
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_trylock() of destroyed mutex @ %s:%d", file, line));
KASSERT(LOCK_CLASS(&m->lock_object) != &lock_class_mtx_spin,