]> xenbits.xensource.com Git - osstest.git/commitdiff
starvation: Do not count more than half a flight as starved
authorIan Jackson <iwj@xenproject.org>
Thu, 22 Oct 2020 14:38:12 +0000 (15:38 +0100)
committerIan Jackson <iwj@xenproject.org>
Thu, 22 Oct 2020 16:42:03 +0000 (17:42 +0100)
This seems like a sensible rule.

This also prevents the following bizarre behaviour: when a flight has
a handful of jobs that cannot be run at all (eg because it's a
commissioning flight for only hosts of a particular arch), those jobs
can complete quite quickly.  Even with a high X value because only a
smallish portion of the flight has finished, this can lead to a modest
threshhold value.  This combines particularly badly with commissioning
flights, where the duraation estimates are often nonsense.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
ts-hosts-allocate-Executive

index b216186a49e5a9ff2cbd1a6970b0e72a49870aad..459b9215a448a38c3e8a6ebc93206bbb2979a476 100755 (executable)
@@ -863,7 +863,7 @@ sub starving ($$) {
        "D=%d W=%d X=%.3f t_D=%s t_me=%s t_lim=%.3f X'=%.4f (fi.s=%s)",
        $d, $w, $X, $total_d, $projected_me, $lim, $Xcmp,
        $fi->{started} - $now;
-    my $bad = $projected_me > $lim;
+    my $bad = $projected_me > $lim && $d >= $w;
     return ($bad, $m);
 }