]> xenbits.xensource.com Git - osstest.git/commitdiff
ts-host-alloc-Executive: Honour various hostalloc_* runvars
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 2 Jul 2015 17:27:28 +0000 (18:27 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 21 Sep 2015 13:39:28 +0000 (14:39 +0100)
We honour
  hostalloc_maxbonus_variation
  hostalloc_bonus_previousfail
  hostalloc_bonus_sharereuse
and make them default to their previous values.

These should be set as `synth' runvars during flight construction, so
that they are not copied into flights generated by cs-bisection-step
or cs-adjust-flight.  cs-bisection-step makes its own arrangements for
host specification.  So should the caller of cs-adjust-flight (perhaps
via the blessing system).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Incorporate note about `synth'-ness in commit message.

ts-hosts-allocate-Executive

index 35a9347a06cd3c7e800401d61b6591e389f315a1..dd9fcf2882ba1e624ffc9f2e75ce80f007c23901 100755 (executable)
@@ -564,14 +564,19 @@ sub hid_recurse ($$) {
 
     my $log_variation_age = log(1+$variation_age/86400);
     my $variation_bonus = $log_variation_age * 3600*2;
-    my $max_variation_bonus = 12*3600;
+    my $max_variation_bonus = $r{hostalloc_maxbonus_variation} // 12*3600;
     $variation_bonus=$max_variation_bonus
        if $variation_bonus>$max_variation_bonus;
 
+    my $prevfail_bonus = $r{hostalloc_bonus_previousfail} // 7.0*86400;
+    my $prevfail_equiv_bonus = $prevfail_bonus * (6.5 / 7.0);
+
+    my $share_reuse_bonus = $r{hostalloc_bonus_sharereuse} // 10000;
+
     my $cost= $start_time
        + $duration_for_cost
-        - ($previously_failed      ==@hids ?   7*86400 :
-          $previously_failed_equiv==@hids ? 6.5*86400 :
+        - ($previously_failed      ==@hids ? $prevfail_bonus       :
+          $previously_failed_equiv==@hids ? $prevfail_equiv_bonus :
           # We wait 7d extra to try a failing test on the same
           # hardware, or 6.5d on `equivalent' hardware (as defined by
           # equiv-* flags).  Compared to `equivalent' hardware, we
@@ -579,7 +584,7 @@ sub hid_recurse ($$) {
           0)
         + ($previously_failed || $previously_failed_equiv
           ? (-$max_variation_bonus+$variation_bonus) : -$variation_bonus)
-       - $share_reuse * 10000;
+       - $share_reuse * $share_reuse_bonus;
     
     print DEBUG "$dbg FINAL start=$start_time va=$variation_age".
        " variation_bonus=$variation_bonus".