Add a new informative KASSERT to ensure that a process is in the SRUN state

before we return it to cpu_switch().
This commit is contained in:
John Baldwin 2001-03-09 03:59:50 +00:00
parent 2e5fc9fd7e
commit 3a3f608288
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=74014

View file

@ -190,6 +190,9 @@ runq_choose(struct runq *rq)
rqh = &rq->rq_queues[pri];
p = TAILQ_FIRST(rqh);
KASSERT(p != NULL, ("runq_choose: no proc on busy queue"));
KASSERT(p->p_stat == SRUN,
("runq_chose: process %d(%s) in state %d", p->p_pid,
p->p_comm, p->p_stat));
CTR3(KTR_RUNQ, "runq_choose: pri=%d p=%p rqh=%p", pri, p, rqh);
TAILQ_REMOVE(rqh, p, p_procq);
if (TAILQ_EMPTY(rqh)) {