<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 6, 2018 at 10:47 AM Daniel P. Berrangé <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Aug 06, 2018 at 07:20:10AM +0200, Christian Ehrhardt wrote:<br>
> In that case I wonder what the libvirt community thinks of the proposed<br>
> general "Pid is gone means we can assume it is dead" approach?<br>
<br>
The key thing with the shutdown process is that we use the dissapperance of<br>
the PID as the flag to indicate that it is safe to release any resources that<br>
the PID was using. eg the hostdevs are now available for another guest to use.<br>
<br>
I'd be concerned that if we looking /proc/$PID going away as the flag, then<br>
we would be releasing the hostdevs for reuse, before the kernel has cleaned<br>
them up. In the best case this would result in a 2nd guest failing to start<br>
because the device was still in the case, in the worst case we could crash<br>
the entire host (though I'd be hopeful vfio prevents that).<br></blockquote><div> </div><div>Yeah I agree that ressources being in use could lead to bad and rather hard to debug problems.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> An alternative would be to understand on the Kernel side why the PID is<br>
> gone "too early" and fix that so it stays until fully cleaned up.<br>
> But even then on the Libvirt side we would need the extended timeout values.<br>
<br>
Yeah, looks like extended timeouts are unavoidable. The only real optimization<br>
would be to pass an explicit timeout to the kill method, increasing it by 2<br>
seconds for each hostdev that is assigned. That way we'll scale the timeout<br>
up as we need, so don't have to predict the worst case number of assigned<br>
devices.<br></blockquote><div><br></div><div>I'd do both:</div><div>- extending the KILL path (if force is set) timeout in general to give bad systems a chance</div><div>- extend the maximum by 2s per hostdev</div><div><br></div><div>I'll submit that in a few minutes as a reply.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards,<br>
Daniel<br>
-- <br>
|: <a href="https://berrange.com" rel="noreferrer" target="_blank">https://berrange.com</a>      -o-    <a href="https://www.flickr.com/photos/dberrange" rel="noreferrer" target="_blank">https://www.flickr.com/photos/dberrange</a> :|<br>
|: <a href="https://libvirt.org" rel="noreferrer" target="_blank">https://libvirt.org</a>         -o-            <a href="https://fstop138.berrange.com" rel="noreferrer" target="_blank">https://fstop138.berrange.com</a> :|<br>
|: <a href="https://entangle-photo.org" rel="noreferrer" target="_blank">https://entangle-photo.org</a>    -o-    <a href="https://www.instagram.com/dberrange" rel="noreferrer" target="_blank">https://www.instagram.com/dberrange</a> :|<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(136,136,136);font-size:12.8px">Christian Ehrhardt</span><div style="color:rgb(136,136,136);font-size:12.8px">Software Engineer, Ubuntu Server</div><div style="color:rgb(136,136,136);font-size:12.8px">Canonical Ltd</div></div></div></div></div></div>