diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2012-12-22 09:37:34 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2012-12-22 09:37:34 +0000 |
commit | cd2fe4e632de2dcf3c4ca17242c9609bf34746fe (patch) | |
tree | 223c35655c8b163024a006c82d65f305e5d2126d /sys/kern/kern_rmlock.c | |
parent | c6719ccdef73725bfe780ea617f8b0c686cc274b (diff) | |
download | src-cd2fe4e632de2dcf3c4ca17242c9609bf34746fe.tar.gz src-cd2fe4e632de2dcf3c4ca17242c9609bf34746fe.zip |
Fixup r240424: On entering KDB backends, the hijacked thread to run
interrupt context can still be idlethread. At that point, without the
panic condition, it can still happen that idlethread then will try to
acquire some locks to carry on some operations.
Skip the idlethread check on block/sleep lock operations when KDB is
active.
Reported by: jh
Tested by: jh
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=244582
Diffstat (limited to 'sys/kern/kern_rmlock.c')
-rw-r--r-- | sys/kern/kern_rmlock.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index 30400b178217..ebf0f769839a 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/kdb.h> #include <sys/ktr.h> #include <sys/lock.h> #include <sys/mutex.h> @@ -494,7 +495,7 @@ void _rm_wlock_debug(struct rmlock *rm, const char *file, int line) if (SCHEDULER_STOPPED()) return; - KASSERT(!TD_IS_IDLETHREAD(curthread), + KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), ("rm_wlock() by idle thread %p on rmlock %s @ %s:%d", curthread, rm->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&rm->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, @@ -539,7 +540,7 @@ _rm_rlock_debug(struct rmlock *rm, struct rm_priotracker *tracker, if (SCHEDULER_STOPPED()) return (1); - KASSERT(!TD_IS_IDLETHREAD(curthread), + KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), ("rm_rlock() by idle thread %p on rmlock %s @ %s:%d", curthread, rm->lock_object.lo_name, file, line)); if (!trylock && (rm->lock_object.lo_flags & RM_SLEEPABLE)) |