]> xenbits.xensource.com Git - osstest.git/commitdiff
host reuse: Jiggle the infra-priority a bit, within a flight
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 22 Nov 2017 11:38:05 +0000 (11:38 +0000)
committerIan Jackson <iwj@xenproject.org>
Wed, 7 Oct 2020 16:48:33 +0000 (17:48 +0100)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
ts-hosts-allocate-Executive

index a50f8bf3d9ba599edf901d82cca7e137b4abae00..c1002fc900980def96fcdab7d71a7f6b0e11653f 100755 (executable)
@@ -733,8 +733,13 @@ sub alloc_hosts () {
         ? -10000
         : -10 * @hids;
 
-    my $infrapriority =
-       ($r{hosts_infraprioritygroup} // '') =~ m/^(\d+):/ ? $1 : undef;
+    my $infrapriority;
+    if (($r{hosts_infraprioritygroup} // '') =~ m/^(\d+):/) {
+       $infrapriority = ($1 * 100) + ($$ % 100);
+       # $$ provides a pseudorandom element, which arranges that jobs
+       # in a group roughly take turns to take the scheduling lead,
+       # which will hopefully help them converge.
+    }
 
     my $ok = alloc_resources(WaitStart =>
                     ($ENV{OSSTEST_RESOURCE_WAITSTART} || $fi->{started}),