]> git.lizzy.rs Git - plan9front.git/commitdiff
kernel: fix livelock in rebalance (thanks Richard Miller)
authorcinap_lenrek <cinap_lenrek@felloff.net>
Mon, 17 Sep 2018 22:53:05 +0000 (00:53 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Mon, 17 Sep 2018 22:53:05 +0000 (00:53 +0200)
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

index 5a530395fc43a30585ebbd220c393678890a0acd..4d5b98f6f70940777066ffde4b0dd846657e700c 100644 (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);