Explicitly document how we implicitly enforce the lock order of sleep
locks before spin locks.
This commit is contained in:
parent
3eb933c093
commit
48c343df5f
@ -474,6 +474,11 @@ witness_lock(struct lock_object *lock, int flags, const char *file, int line)
|
|||||||
td = curthread;
|
td = curthread;
|
||||||
|
|
||||||
if (class->lc_flags & LC_SLEEPLOCK) {
|
if (class->lc_flags & LC_SLEEPLOCK) {
|
||||||
|
/*
|
||||||
|
* Since spin locks include a critical section, this check
|
||||||
|
* impliclty enforces a lock order of all sleep locks before
|
||||||
|
* all spin locks.
|
||||||
|
*/
|
||||||
if (td->td_critnest != 0 && (flags & LOP_TRYLOCK) == 0)
|
if (td->td_critnest != 0 && (flags & LOP_TRYLOCK) == 0)
|
||||||
panic("blockable sleep lock (%s) %s @ %s:%d",
|
panic("blockable sleep lock (%s) %s @ %s:%d",
|
||||||
class->lc_name, lock->lo_name, file, line);
|
class->lc_name, lock->lo_name, file, line);
|
||||||
|
Loading…
Reference in New Issue
Block a user