Re: [PATCH v2 02/14] vfio: Simplify the lifetime logic for vfio_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 16, 2021 at 02:24:54PM -0600, Alex Williamson wrote:
> > > @@ -935,32 +916,18 @@ void *vfio_del_group_dev(struct device *dev)
> > >  	WARN_ON(!unbound);
> > > 
> > >  	vfio_device_put(device);
> > > -
> > > -	/*
> > > -	 * If the device is still present in the group after the above
> > > -	 * 'put', then it is in use and we need to request it from the
> > > -	 * bus driver.  The driver may in turn need to request the
> > > -	 * device from the user.  We send the request on an arbitrary
> > > -	 * interval with counter to allow the driver to take escalating
> > > -	 * measures to release the device if it has the ability to do so.
> > > -	 */  
> > 
> > Above comment still makes sense even with this patch. What about
> > keeping it? otherwise:
> 
> The comment is not exactly correct after this code change either, the
> device will always be present in the group after this 'put'.  Instead,
> the completion now indicates the reference count has reached zero.  If
> it's worthwhile to keep more context to the request callback, perhaps:
> 
> 	/*
> 	 * If there are still outstanding device references, such as
> 	 * from the device being in use, periodically kick the optional
> 	 * device request callback while waiting.
> 	 */
> 
> It's also a little obvious that's what we're doing here even without
> the comment.  Thanks,

Indeed, that is the explanation why I dropped it.

Thanks,
Jason



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux