From: Jason Gunthorpe <jgg@nvidia.com>
To: "Jason J. Herne" <jjherne@linux.ibm.com>
Cc: Tony Krowiak <akrowiak@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
borntraeger@de.ibm.com, cohuck@redhat.com,
pasic@linux.vnet.ibm.com, alex.williamson@redhat.com,
kwankhede@nvidia.com, frankja@linux.ibm.com, david@redhat.com,
imbrenda@linux.ibm.com, hca@linux.ibm.com
Subject: Re: [PATCH] s390/vfio-ap: do not use open locks during VFIO_GROUP_NOTIFY_SET_KVM notification
Date: Wed, 30 Jun 2021 08:55:08 -0300 [thread overview]
Message-ID: <20210630115508.GB10820@nvidia.com> (raw)
In-Reply-To: <a37d2816-47fc-ef6b-eb59-c5782e13ca12@linux.ibm.com>
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
prev parent reply other threads:[~2021-06-30 11:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-25 22:07 [PATCH] s390/vfio-ap: do not use open locks during VFIO_GROUP_NOTIFY_SET_KVM notification Tony Krowiak
2021-06-28 17:34 ` Jason Gunthorpe
2021-06-28 18:20 ` Tony Krowiak
2021-06-28 18:22 ` Jason Gunthorpe
2021-06-28 18:27 ` Tony Krowiak
2021-06-28 20:29 ` Halil Pasic
2021-06-30 14:31 ` Tony Krowiak
2021-06-30 22:39 ` Halil Pasic
2021-07-01 14:28 ` Tony Krowiak
2021-07-05 14:13 ` Jason Gunthorpe
2021-07-06 13:39 ` Tony Krowiak
2021-07-06 13:49 ` Jason Gunthorpe
2021-07-06 22:43 ` Tony Krowiak
2021-06-29 13:21 ` Jason J. Herne
2021-06-30 11:55 ` Jason Gunthorpe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210630115508.GB10820@nvidia.com \
--to=jgg@nvidia.com \
--cc=akrowiak@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=kwankhede@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pasic@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox