kernel: fix livelock in rebalance (thanks Richard Miller)

Once a second rebalance() is called on cpu0 to adjust priorities,
so cpu-bound processes won't lock others out.  However it was only
adjusting processes which were running on cpu0.  This was observed
to lead to livelock, eg when a higher-priority process spin-waits
for a lock held by a lower priority one.
This commit is contained in:
cinap_lenrek 2018-09-18 00:53:05 +02:00
parent e619a03c28
commit bd49212b46

View file

@ -478,8 +478,6 @@ another:
p = rq->head;
if(p == nil)
continue;
if(p->mp != MACHP(m->machno))
continue;
if(pri == p->basepri)
continue;
updatecpu(p);