Messages in this thread | | | Date | Wed, 30 Jun 2021 08:55:08 -0300 | From | Jason Gunthorpe <> | Subject | Re: [PATCH] s390/vfio-ap: do not use open locks during VFIO_GROUP_NOTIFY_SET_KVM notification |
| |
On Tue, Jun 29, 2021 at 09:21:31AM -0400, Jason J. Herne wrote:
> > + mutex_lock(&matrix_dev->lock); > > - if (matrix_mdev->kvm) { > > - matrix_mdev->kvm_busy = true; > > + if ((matrix_mdev->kvm) && (matrix_mdev->kvm->arch.crypto.crycbd)) { > > mutex_unlock(&matrix_dev->lock); > > > If this function cannot be entered concurrently on separate threads then I > think we can remove this mutex_unlock of matrix_dev->lock,
Don't remove locking around data. If the data is written under a mutex it should be read under a mutex too.
Jason
| |