Just check p_oncpu when determining if a process is executing or not.
We already did this in the SMP case, and it is now maintained in the UP case as well, and makes the code slightly more readable. Note that curproc is always executing, thus the p != curproc test does not need to be performed if the p_oncpu check is made.
This commit is contained in:
parent
2c2105f43d
commit
f145c527cb
@ -283,10 +283,7 @@ schedcpu(arg)
|
||||
p->p_estcpu = decay_cpu(loadfac, p->p_estcpu);
|
||||
resetpriority(p);
|
||||
if (p->p_pri.pri_level >= PUSER) {
|
||||
if ((p != curproc) &&
|
||||
#ifdef SMP
|
||||
p->p_oncpu == NOCPU && /* idle */
|
||||
#endif
|
||||
if (p->p_oncpu == NOCPU && /* idle */
|
||||
p->p_stat == SRUN &&
|
||||
(p->p_sflag & PS_INMEM) &&
|
||||
(p->p_pri.pri_level / RQ_PPQ) !=
|
||||
|
Loading…
Reference in New Issue
Block a user