lkml.org 
[lkml]   [2021]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/7] vfio/pci: Use vfio_device_unmap_mapping_range()
On Thu, Aug 05, 2021 at 11:07:35AM -0600, Alex Williamson wrote:
> @@ -2281,15 +2143,13 @@ static int vfio_pci_try_zap_and_vma_lock_cb(struct pci_dev *pdev, void *data)
>
> vdev = container_of(device, struct vfio_pci_device, vdev);
>
> - /*
> - * Locking multiple devices is prone to deadlock, runaway and
> - * unwind if we hit contention.
> - */
> - if (!vfio_pci_zap_and_vma_lock(vdev, true)) {
> + if (!down_write_trylock(&vdev->memory_lock)) {
> vfio_device_put(device);
> return -EBUSY;
> }

Now that this is simplified so much, I wonder if we can drop the
memory_lock and just use the dev_set->lock?

That avoids the whole down_write_trylock thing and makes it much more
understandable?

Jason

\
 
 \ /
  Last update: 2021-08-06 03:04    [W:0.147 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site