[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210630115508.GB10820@nvidia.com>
Date: Wed, 30 Jun 2021 08:55:08 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: "Jason J. Herne" <jjherne@...ux.ibm.com>
Cc: Tony Krowiak <akrowiak@...ux.ibm.com>, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org, borntraeger@...ibm.com,
cohuck@...hat.com, pasic@...ux.vnet.ibm.com,
alex.williamson@...hat.com, kwankhede@...dia.com,
frankja@...ux.ibm.com, david@...hat.com, imbrenda@...ux.ibm.com,
hca@...ux.ibm.com
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
Powered by blists - more mailing lists