lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181119110248.68214069.cohuck@redhat.com>
Date:   Mon, 19 Nov 2018 11:02:48 +0100
From:   Cornelia Huck <cohuck@...hat.com>
To:     Alex Williamson <alex.williamson@...hat.com>
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        christian.ehrhardt@...onical.com, eric.auger@...hat.com
Subject: Re: [PATCH v2] vfio/pci: Parallelize device open and release

On Fri, 16 Nov 2018 09:18:41 -0700
Alex Williamson <alex.williamson@...hat.com> wrote:

> In commit 61d792562b53 ("vfio-pci: Use mutex around open, release, and
> remove") a mutex was added to freeze the refcnt for a device so that
> we can handle errors and perform bus resets on final close.  However,
> bus resets can be rather slow and a global mutex here is undesirable.
> Evaluating the potential locking granularity, a per-device mutex
> provides the best resolution but with multiple devices on a bus all
> released concurrently, they'll race to acquire each other's mutex,
> likely resulting in no reset at all if we use trylock.  We therefore
> lock at the granularity of the bus/slot reset as we're only attempting
> a single reset for this group of devices anyway.  This allows much
> greater scaling as we're bounded in the number of devices protected by
> a single reflck object.
> 
> Reported-by: Christian Ehrhardt <christian.ehrhardt@...onical.com>
> Tested-by: Christian Ehrhardt <christian.ehrhardt@...onical.com>
> Reviewed-by: Eric Auger <eric.auger@...hat.com>
> Signed-off-by: Alex Williamson <alex.williamson@...hat.com>
> ---
> 
> v2:
>  - Rolled in PTR_ERR_OR_ZERO suggestion from kbuild bot
>  - Updated commit log and comments per Eric's feedback
> 
>  drivers/vfio/pci/vfio_pci.c         |  160 ++++++++++++++++++++++++++++++-----
>  drivers/vfio/pci/vfio_pci_private.h |    6 +
>  2 files changed, 142 insertions(+), 24 deletions(-)

Reviewed-by: Cornelia Huck <cohuck@...hat.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ