Re: [PATCH 05/13] kvm/vfio: Provide struct kvm_device_ops::release() insted of ::destroy()

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

 



On Fri, Jan 20, 2023 at 02:00:26PM +0000, Liu, Yi L wrote:
> Say in the same time, we have thread B closes device, it will hold
> group_lock first and then calls kvm_put_kvm() which is the last
> reference, then it would loop the kvm-device list. Currently, it is
> not holding kvm_lock. But it also manipulating the kvm-device list,
> should it hold kvm_lock? 

No. When using refcounts if the refcount is 0 it guarantees there are
no other threads that can possibly touch this memory, so any locks
internal to the memory are not required.

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