lkml.org 
[lkml]   [2021]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2021-06-30 13:56    [W:0.107 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site