Re: [PATCH v2 01/14] vfio: Remove extra put/gets around vfio_device->group

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

 



On Tue, Mar 16, 2021 at 07:33:55AM +0000, Tian, Kevin wrote:

> > It is tricky to see, but the get at the start of vfio_del_group_dev() is
> > actually pairing with the put hidden inside vfio_device_put() a few lines
> > below.
> 
> I feel that the put inside vfio_device_put was meant to pair with the get in 
> vfio_group_create_device before this patch is applied. Because vfio_device_
> put may drop the last reference to the group, vfio_del_group_dev then 
> issues its own get to hold the reference until the put at the end of the func. 

Here I am talking about how this patch removes 3 gets and 2 puts -
which should be a red flag. The reason it is OK is because the 3rd
extra removed get is paring with the put hidden inside another put.

> > @@ -1008,6 +990,7 @@ void *vfio_del_group_dev(struct device *dev)
> >  	if (list_empty(&group->device_list))
> >  		wait_event(group->container_q, !group->container);
> > 
> > +	/* Matches the get in vfio_group_create_device() */
> 
> There is no get there now.

It is refering to this comment:

/* Our reference on group is moved to the device */

The get is a move in this case

Later delete the function and this becomes perfectly clear

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