lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Aug 2021 08:57:22 -0300
From:   Jason Gunthorpe <>
To:     Christoph Hellwig <>
Cc:     Alex Williamson <>,,,
Subject: Re: [PATCH 3/7] vfio/pci: Use vfio_device_unmap_mapping_range()

On Tue, Aug 10, 2021 at 09:51:07AM +0100, Christoph Hellwig wrote:
> On Fri, Aug 06, 2021 at 02:17:45PM -0600, Alex Williamson wrote:
> > > 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?
> > 
> > Hmm, that would make this case a lot easier, but using a mutex,
> > potentially shared across multiple devices, taken on every non-mmap
> > read/write doesn't really feel like a good trade-off when we're
> > currently using a per device rwsem to retain concurrency here.  Thanks,
> Using a per-set percpu_rw_semaphore might be a good plan here.  Probably
> makes sense to do that incrementally after this change, though.

I'm not sure there is a real performance win to chase here? Doesn't
this only protect mmap against reset? The mmap isn't performance
sensitive, right?

If this really needs extra optimization adding a rwsem to the devset
and using that across the whole set would surely be sufficient.


Powered by blists - more mailing lists