1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

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:
John Baldwin 2001-07-03 08:00:57 +00:00
parent 9d36b83e2c
commit 97b4306f0f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79131

View File

@ -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) !=