- Add an extra check in priority_propagation() for UP systems to ensure we
don't end up back at ourselves which would indicate deadlock. - Add the proc lock to the witness dup_list as we may hold more than one process lock at a time. - Don't assert a mutex is owned in _mtx_unlock_sleep() as that is too late. We do the checks in the macros instead.
This commit is contained in:
parent
6451855f6d
commit
1b43703b47
@ -216,6 +216,14 @@ propagate_priority(struct proc *p)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SMP
|
||||||
|
/*
|
||||||
|
* For UP, we check to see if p is curproc (this shouldn't
|
||||||
|
* ever happen however as it would mean we are in a deadlock.)
|
||||||
|
*/
|
||||||
|
KASSERT(p != curproc, ("Deadlock detected"));
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If on run queue move to new run queue, and
|
* If on run queue move to new run queue, and
|
||||||
* quit.
|
* quit.
|
||||||
@ -501,7 +509,6 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line)
|
|||||||
int pri;
|
int pri;
|
||||||
|
|
||||||
p = curproc;
|
p = curproc;
|
||||||
MPASS4(mtx_owned(m), "mtx_owned(mpp)", file, line);
|
|
||||||
|
|
||||||
if (mtx_recursed(m)) {
|
if (mtx_recursed(m)) {
|
||||||
if (--(m->mtx_recurse) == 0)
|
if (--(m->mtx_recurse) == 0)
|
||||||
@ -949,6 +956,7 @@ static char *order_list[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char *dup_list[] = {
|
static char *dup_list[] = {
|
||||||
|
"process lock",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -216,6 +216,14 @@ propagate_priority(struct proc *p)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SMP
|
||||||
|
/*
|
||||||
|
* For UP, we check to see if p is curproc (this shouldn't
|
||||||
|
* ever happen however as it would mean we are in a deadlock.)
|
||||||
|
*/
|
||||||
|
KASSERT(p != curproc, ("Deadlock detected"));
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If on run queue move to new run queue, and
|
* If on run queue move to new run queue, and
|
||||||
* quit.
|
* quit.
|
||||||
@ -501,7 +509,6 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line)
|
|||||||
int pri;
|
int pri;
|
||||||
|
|
||||||
p = curproc;
|
p = curproc;
|
||||||
MPASS4(mtx_owned(m), "mtx_owned(mpp)", file, line);
|
|
||||||
|
|
||||||
if (mtx_recursed(m)) {
|
if (mtx_recursed(m)) {
|
||||||
if (--(m->mtx_recurse) == 0)
|
if (--(m->mtx_recurse) == 0)
|
||||||
@ -949,6 +956,7 @@ static char *order_list[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char *dup_list[] = {
|
static char *dup_list[] = {
|
||||||
|
"process lock",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -216,6 +216,14 @@ propagate_priority(struct proc *p)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SMP
|
||||||
|
/*
|
||||||
|
* For UP, we check to see if p is curproc (this shouldn't
|
||||||
|
* ever happen however as it would mean we are in a deadlock.)
|
||||||
|
*/
|
||||||
|
KASSERT(p != curproc, ("Deadlock detected"));
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If on run queue move to new run queue, and
|
* If on run queue move to new run queue, and
|
||||||
* quit.
|
* quit.
|
||||||
@ -501,7 +509,6 @@ _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line)
|
|||||||
int pri;
|
int pri;
|
||||||
|
|
||||||
p = curproc;
|
p = curproc;
|
||||||
MPASS4(mtx_owned(m), "mtx_owned(mpp)", file, line);
|
|
||||||
|
|
||||||
if (mtx_recursed(m)) {
|
if (mtx_recursed(m)) {
|
||||||
if (--(m->mtx_recurse) == 0)
|
if (--(m->mtx_recurse) == 0)
|
||||||
@ -949,6 +956,7 @@ static char *order_list[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static char *dup_list[] = {
|
static char *dup_list[] = {
|
||||||
|
"process lock",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user