Skip to contentSkip to conversation

starvation: Do not give up if there are other jobs running

PATCH New Ian Jackson 1 participant 1 message Jun 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 starvation: Do not give up if there are other jobs running

We want those other jobs to finish so that we can include the time they took, and the fact that they completed, in our calculations.

---
 ts-hosts-allocate-Executive | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
ts-hosts-allocate-Executive +10 -2
index 6b3da600..079ef1d1 100755
@@ -788,9 +788,17 @@ sub starving ($$) {
     my $maxfin=0;
     while (my ($j,$st,$fin) = $starvation_q->fetchrow_array()) {
 	if ($st eq 'preparing' ||
-	    $st eq 'queued' ||
-	    $st eq 'running') {
+	    $st eq 'queued') {
 	    $w++;
+	} elsif ($st eq 'running') {
+	    # We don't quit if there are still jobs running.  Instead
+	    # we wait until they are done and then see if how much we
+	    # would be delaying their results.  This does mean that a
+	    # flight can be kept going, rather than being treated as
+	    # starved, by a constant trickle of late jobs.  But that
+	    # is indistinguishable from a flight which is at the head
+	    # of the queue for a small set of resources.
+	    return (0, "job $j status $st, don't give up just yet");
 	} else {
 	    $d++;
 	    return (0, "job $j status $st but no step finished time!")
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel