From bd49212b467c60d6d5e4e2eefc13ec88012ec785 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 18 Sep 2018 00:53:05 +0200 Subject: 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. --- sys/src/9/port/proc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/src/9/port/proc.c b/sys/src/9/port/proc.c index 5a530395f..4d5b98f6f 100644 --- a/sys/src/9/port/proc.c +++ b/sys/src/9/port/proc.c @@ -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); -- cgit v1.2.3