diff mbox series

[OSSTEST,53/82] host reuse: Jiggle the infra-priority a bit, within a flight

Message ID 20201007180024.7932-54-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series Reuse test hosts | expand

Commit Message

Ian Jackson Oct. 7, 2020, 5:59 p.m. UTC
From: Ian Jackson <ian.jackson@eu.citrix.com>

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ts-hosts-allocate-Executive | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index a50f8bf3..c1002fc9 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -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}),