From: Cornelia Huck <cohuck@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
christian.ehrhardt@canonical.com, eric.auger@redhat.com
Subject: Re: [PATCH v2] vfio/pci: Parallelize device open and release
Date: Mon, 19 Nov 2018 11:02:48 +0100 [thread overview]
Message-ID: <20181119110248.68214069.cohuck@redhat.com> (raw)
In-Reply-To: <154238501981.17682.10484940408205923021.stgit@gimli.home>
On Fri, 16 Nov 2018 09:18:41 -0700
Alex Williamson <alex.williamson@redhat.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@canonical.com>
> Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.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@redhat.com>
prev parent reply other threads:[~2018-11-19 10:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 16:18 [PATCH v2] vfio/pci: Parallelize device open and release Alex Williamson
2018-11-19 10:02 ` Cornelia Huck [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=20181119110248.68214069.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=christian.ehrhardt@canonical.com \
--cc=eric.auger@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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