Skip to contentSkip to conversation

ms-*: Support for host reuse

PATCH New Ian Jackson 1 participant 4 messages Apr 23, 2018

lore
Share & tools
lore
#0 lore raw

cover ms-*: Support for host reuse

These three patches help support within-flight test hose reuse.

Currently there is nothing that uses these new features in any public branch. I have a private branch with the client side, which has seen some testing and which I hope will be ready soon.

These daemon changes have been in production in the Citrix Cambridge instance for quite some time, and have not caused any trouble there.

So I intend to update the Massachussets daemons to this version too.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#1 lore raw

PATCH 1/3 ms-queuedaemon: Support infra-priority

This will allow a flight to order the queueing its own test jobs more sensibly without interfering with inter-flight priority.

---
 README.planner | 1 +
 ms-queuedaemon | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
README.planner +1 -0
index fec7482..c33aae1 100644
@@ -238,6 +238,7 @@ ms-queuedaemon commands
         > set-info priority ...                      } used for
         > set-info sub-priority ...                  } queue adjustment
         > set-info wait-start-adjust ...             }
+        > set-info infra-priority ...                }
 
         > set-info feature-noalloc 1
 	        The client understands `!OK think noalloc'.
ms-queuedaemon +4 -2
index 430860a..f02abf3 100755
@@ -599,15 +599,17 @@ proc chan-order-key {chan} {
 
     set priority [chan-get-info $chan {int($info(priority))} 0]
     set subpriority [chan-get-info $chan {int($info(sub-priority))} 0]
+    set infrapriority [chan-get-info $chan {int($info(infra-priority))} 0]
 
     set waitstart "$info(wait-start use)"
     incr waitstart [chan-get-info $chan {int($info(wait-start-adjust))} 0]
 
     #puts stderr "priority $chan $priority $emsg"
-    return [format "%011d.%011d.%011d" \
+    return [format "%011d.%011d.%011d.%011d" \
                 [expr {$priority+1000000000}] \
                 [expr {$subpriority+1000000000}] \
-                $waitstart]
+                $waitstart \
+                [expr {$infrapriority+1000000000}]]
 }
 
 proc cmd/prod {chan desc} {
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#2 lore raw

PATCH 2/3 ms-planner: include PreviousShare information in Unshare events

In reply to Ian Jackson

We can't put this in $evt->{Share} because existing clients will see it there and assume it means the resource is shared.

---
 ms-planner | 3 +++
 1 file changed, 3 insertions(+)
ms-planner +3 -0
index af0c746..5d20cc2 100755
@@ -234,6 +234,7 @@ sub launder_check_plan () {
 			Type => Unshare,
 			Avail => 1,
 			Info => $cshare->{Type},
+			PreviousShare => $cshare,
 		    };
 		    $cshare= undef;
 		}
@@ -412,6 +413,7 @@ sub cmd_get_plan () {
 	my @jevts;
 	foreach my $evt (@$evts) {
 	    my $share= $evt->{Share};
+	    my $previousshare= $evt->{PreviousShare};
 	    my $job= $evt->{Job};
 	    push @jevts, {
 		Time => $evt->{Time} - $plan->{Start},
@@ -419,6 +421,7 @@ sub cmd_get_plan () {
 		Avail => $evt->{Avail},
 		($job ? (Job => $job) : ()),
 		($share ? (Share => $share) : ()),
+		($previousshare ? (PreviousShare => $previousshare) : ()),
 	    };
 	}
 	$jplan->{Events}{$reso}= \@jevts;
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw

PATCH 3/3 ms-planner: Including Unshare event for previous sharing state

In reply to Ian Jackson

Arrange for the initial plan to contain an Unshare event for resources which are unallocated, but currently recorded as shared (ie, they might be ready for reuse).

Specifically, we need to:

* Include the Wear in the information for a host with no unallocatable shares (since the consumers might want to reuse the current state).

* When processing the allocations in cmd_reset, look for sharing entries (ie, things we found allocated by magic/shared, and made a note in %currentshare) that didn't have any corresponding allocations of shares. Generate an Unshare event for them.

* When we find an Unshare event in the plan, we used to remove it. Now we keep it if it's the first thing in the plan. (For subsequent entries callers don't generally need it because they can find the sharing info from previous events.) When it is the first thing in the plan, we do some checks on it.

---
 ms-planner | 34 ++++++++++++++++++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)
ms-planner +32 -2
index 5d20cc2..2b8b6c2 100755
@@ -151,6 +151,7 @@ END
             OnlyPreparing => 1,
             Shares => $shares->{shares},
             Type => $sharing->{sharetype},
+            Wear => $sharing->{wear},
         };
     }
 
@@ -185,8 +186,21 @@ sub launder_check_plan () {
             };
 
 	    my $type= $evt->{Type};
-	    next if $type eq Unshare;
-
+	    if ($type eq Unshare) {
+		if (!@evts) {
+		    # record inherited sharing info
+		    $bad->('unshare not in past')
+			unless $evt->{Time} <= $plan->{Start};
+		    $bad->('unshare avail')
+			unless $evt->{Avail} == 1;
+		    my $eshare = $evt->{PreviousShare};
+		    $eshare->{$_} // $bad->("unshare $_")
+			foreach qw(Type Wear Shares);
+		    push @evts, $evt;
+		}
+		next;
+	    }
+		
 	    push @evts, $evt;
 
             $bad->('type') unless $type eq Start || $type eq End;
@@ -394,6 +408,22 @@ END
 	};
     }
 
+    foreach my $reskey (keys %currentshare) {
+	my $cshare = $currentshare{$reskey};
+	next if $plan->{Events}{$reskey};
+	print DEBUG "document existing quiescent sharing $reskey".
+	    " share.Type $cshare->{Type}\n";
+	my $evt = {
+            Time => $plan->{Start},
+            Type => Unshare,
+	    Avail => 1,
+            Info => 'recently shared $cshare->{Type}',
+            PreviousShare => { %$cshare },
+	};
+	delete $evt->{PreviousShare}{OnlyPreparing};
+	push @{ $plan->{Events}{$reskey} }, $evt;
+    }
+
     # Now everything in the plan is good except that we
     # need to sort the lists and compute Avails, which is done by
     # check_write_new_plan.
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel