From: Ian Jackson Date: Thu, 2 Jul 2015 17:27:28 +0000 (+0100) Subject: ts-host-alloc-Executive: Honour various hostalloc_* runvars X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bf5c12d6d8075427a695c5eaf502a36eae05c44a;p=osstest.git ts-host-alloc-Executive: Honour various hostalloc_* runvars 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 Acked-by: Ian Campbell --- v2: Incorporate note about `synth'-ness in commit message. --- diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive index 35a9347..dd9fcf2 100755 --- a/ts-hosts-allocate-Executive +++ b/ts-hosts-allocate-Executive @@ -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".