|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [OSSTEST PATCH 21/21] starvation: Better logging/debugging output
Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
ts-hosts-allocate-Executive | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive
index b75927c1..64c4c9f9 100755
--- a/ts-hosts-allocate-Executive
+++ b/ts-hosts-allocate-Executive
@@ -777,8 +777,8 @@ sub most_optimistic ($$$) {
return $optimist->{Got};
}
-sub starving ($) {
- my ($best_start_abs) = @_;
+sub starving ($$) {
+ my ($best_start_abs, $now) = @_;
return (0, 'runvar says never give up') unless %$starvation_p;
return (0, 'no estimate') unless defined $best_start_abs;
$starvation_q->execute($flight);
@@ -801,11 +801,16 @@ sub starving ($) {
# to our expected finish is more than the total time so
# far (for the completed jobs) by the margin X and I
my $X = hostalloc_starvation_calculate_X($starvation_p, $w, $d);
- return (0, 'X=inf') unless defined $X;
+ return (0, "D=$d W=$w X=inf") unless defined $X;
my $total_d = $maxfin - $fi->{started};
my $projected_me = $best_start_abs - $fi->{started};
- my $m = "D=$d W=$w X=$X maxfin=$maxfin";
- my $bad = $projected_me > $X * $total_d + $starvation_p->{I};
+ my $lim = $X * $total_d + $starvation_p->{I};
+ my $Xcmp = ($projected_me - $starvation_p->{I}) / $total_d;
+ my $m = sprintf
+ "D=%d W=%d X=%.3f t_D=%s t_me=%s t_lim=%.3f X'=%.4f (fi.s=%s)",
+ $d, $w, $X, $total_d, $projected_me, $lim, $Xcmp,
+ $fi->{started} - $now;
+ my $bad = $projected_me > $lim;
return ($bad, $m);
}
@@ -876,7 +881,7 @@ sub attempt_allocation {
}
} elsif (%$starvation_p) {
my $est_abs = most_optimistic($best, $now, $starvation_p->{I});
- my ($starving, $m) = starving($est_abs);
+ my ($starving, $m) = starving($est_abs, $now);
$starvation_q->finish();
if (!$starving) {
print DEBUG "not starving: $m\n";
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |