From d8213bee7a4e5ca347e47e799a1b4098201cc148 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 22 Nov 2017 11:38:05 +0000 Subject: [PATCH] host reuse: Jiggle the infra-priority a bit, within a flight Signed-off-by: Ian Jackson --- ts-hosts-allocate-Executive | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive index a50f8bf..c1002fc 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}), -- 2.39.5