linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: gleb@kernel.org, pbonzini@redhat.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, cornelia.huck@de.ibm.com
Subject: Re: [PATCH V3 2/3] kvm: don't register wildcard MMIO EVENTFD on two buses
Date: Mon, 31 Aug 2015 14:33:43 +0300	[thread overview]
Message-ID: <20150831143047-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <55E40A6F.5010003@redhat.com>

On Mon, Aug 31, 2015 at 04:03:59PM +0800, Jason Wang wrote:
> 
> 
> On 08/31/2015 03:29 PM, Michael S. Tsirkin wrote:
> >>>>> Thinking more about this, invoking the 0-length write after
> >>>>> > >> > the != 0 length one would be better: it would mean we only
> >>>>> > >> > handle the userspace MMIO like this.
> >>> > > Right.
> >>> > >
> >> > 
> >> > Using current unittest. This patch is about 2.9% slower than before, and
> >> > invoking 0-length write after is still 1.1% slower (mmio-datamatch-eventfd).
> >> > 
> >> > /patch/result/-+%/
> >> > /base/2957/0/
> >> > /V3/3043/+2.9%/
> >> > /V3+invoking != 0 length first/2990/+1.1%/
> >> > 
> >> > So looks like the best method is not searching KVM_FAST_MMIO_BUS during
> >> > KVM_MMIO_BUS. Instead, let userspace to register both datamatch and
> >> > wildcard in this case. Does this sound good to you?
> > No - we can't change userspace.
> 
> Actually, the change was as simple as following. So I don't get the
> reason why.

Because it's too late - we committed to a specific userspace ABI
when this was merged in kernel, we must maintain it.
Even if I thought yours is a good API (and I don't BTW - it's exposing
internal implementation details) it's too late to change it.

> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 9935029..42ee986 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -288,6 +288,8 @@ static int
> virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
>          if (modern) {
>              memory_region_add_eventfd(modern_mr, modern_addr, 2,
>                                        true, n, notifier);
> +            memory_region_add_eventfd(modern_mr, modern_addr, 0,
> +                                      false, n, notifier);
>          }
>          if (legacy) {
>              memory_region_add_eventfd(legacy_mr, legacy_addr, 2,
> @@ -297,6 +299,8 @@ static int
> virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
>          if (modern) {
>              memory_region_del_eventfd(modern_mr, modern_addr, 2,
>                                        true, n, notifier);
> +            memory_region_del_eventfd(modern_mr, modern_addr, 0,
> +                                      false, n, notifier);
>          }
>          if (legacy) {
>              memory_region_del_eventfd(legacy_mr, legacy_addr, 2,

  reply	other threads:[~2015-08-31 11:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25  9:05 [PATCH V3 1/3] kvm: use kmalloc() instead of kzalloc() during iodev register/unregister Jason Wang
2015-08-25  9:05 ` [PATCH V3 2/3] kvm: don't register wildcard MMIO EVENTFD on two buses Jason Wang
2015-08-25 10:24   ` Cornelia Huck
2015-08-25 11:37   ` Michael S. Tsirkin
2015-08-25 11:51   ` Michael S. Tsirkin
2015-08-26  5:10     ` Jason Wang
2015-08-31  3:12       ` Jason Wang
2015-08-31  7:29         ` Michael S. Tsirkin
2015-08-31  8:03           ` Jason Wang
2015-08-31 11:33             ` Michael S. Tsirkin [this message]
2015-09-01  3:33               ` Jason Wang
2015-09-01  4:31                 ` Michael S. Tsirkin
2015-09-01  4:47                   ` Jason Wang
2015-09-01  6:54                     ` Michael S. Tsirkin
2015-09-01  8:22                       ` Jason Wang
2015-09-01  8:32                         ` Michael S. Tsirkin
2015-08-25  9:05 ` [PATCH V3 3/3] kvm: add tracepoint for fast mmio Jason Wang
2015-08-25 11:36   ` Michael S. Tsirkin
2015-09-07 10:33 ` [PATCH V3 1/3] kvm: use kmalloc() instead of kzalloc() during iodev register/unregister Paolo Bonzini

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=20150831143047-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=gleb@kernel.org \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).