All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Haskins <ghaskins@novell.com>
To: Avi Kivity <avi@redhat.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
	Chris Wright <chrisw@sous-sol.org>,
	Gregory Haskins <gregory.haskins@gmail.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] generic hypercall support
Date: Fri, 08 May 2009 15:59:42 -0400	[thread overview]
Message-ID: <4A048F2E.3080702@novell.com> (raw)
In-Reply-To: <4A048413.4060406@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4225 bytes --]

Avi Kivity wrote:
> Gregory Haskins wrote:
>>>> And likewise, in both cases, G1 would (should?) know what to do with
>>>> that "address" as it relates to G2, just as it would need to know what
>>>> the PIO address is for.  Typically this would result in some kind of
>>>> translation of that "address", but I suppose even this is completely
>>>> arbitrary and only G1 knows for sure.  E.g. it might translate from
>>>> hypercall vector X to Y similar to your PIO example, it might
>>>> completely
>>>> change transports, or it might terminate locally (e.g. emulated device
>>>> in G1).   IOW: G2 might be using hypercalls to talk to G1, and G1
>>>> might
>>>> be using MMIO to talk to H.  I don't think it matters from a topology
>>>> perspective (though it might from a performance perspective).
>>>>         
>>> How can you translate a hypercall?  G1's and H's hypercall mechanisms
>>> can be completely different.
>>>     
>>
>> Well, what I mean is that the hypercall ABI is specific to G2->G1, but
>> the path really looks like G2->(H)->G1 transparently since H gets all
>> the initial exits coming from G2.  But all H has to do is blindly
>> reinject the exit with all the same parameters (e.g. registers,
>> primarily) to the G1-root context.
>>
>> So when the trap is injected to G1, G1 sees it as a normal HC-VMEXIT,
>> and does its thing according to the ABI.  Perhaps the ABI for that
>> particular HC-id is a PIOoHC, so it turns around and does a
>> ioread/iowrite PIO, trapping us back to H.
>>
>> So this transform of the HC-id "X" to PIO("Y") is the translation I was
>> referring to.  It could really be anything, though (e.g. HC "X" to HC
>> "Z", if thats what G1s handler for X told it to do)
>>   
>
> That only works if the device exposes a pio port, and the hypervisor
> exposes HC_PIO.  If the device exposes the hypercall, things break
> once you assign it.

Well, true.  But normally I would think you would resurface the device
from G1 to G2 anyway, so any relevant transform would also be reflected
in the resurfaced device config.  I suppose if you had a hard
requirement that, say, even the pci-config space was pass-through, this
would be a problem.  I am not sure if that is a realistic environment,
though. 
>
>>>   Of course mmio is faster in this case since it traps directly.
>>>
>>> btw, what's the hypercall rate you're seeing? at 10K hypercalls/sec, a
>>> 0.4us difference will buy us 0.4% reduction in cpu load, so let's see
>>> what's the potential gain here.
>>>     
>>
>> Its more of an issue of execution latency (which translates to IO
>> latency, since "execution" is usually for the specific goal of doing
>> some IO).  In fact, per my own design claims, I try to avoid exits like
>> the plague and generally succeed at making very few of them. ;)
>>
>> So its not really the .4% reduction of cpu use that allures me.  Its the
>> 16% reduction in latency.  Time/discussion will tell if its worth the
>> trouble to use HC or just try to shave more off of PIO.  If we went that
>> route, I am concerned about falling back to MMIO, but Anthony seems to
>> think this is not a real issue.
>>   
>
> You need to use absolute numbers, not percentages off the smallest
> component.  If you want to reduce latency, keep things on the same
> core (IPIs, cache bounces are more expensive than the 200ns we're
> seeing here).
>
>
Ok, so there are no shortages of IO cards that can perform operations in
the order of 10us-15us.  Therefore a 350ns latency (the delta between
PIO and HC) turns into a 2%-3.5% overhead when compared to bare-metal. 
I am not really at liberty to talk about most of the kinds of
applications that might care.  A trivial example might be PTPd clock
distribution.

But this is going nowhere.  Based on Anthony's asserting that the MMIO
fallback worry is unfounded, and all the controversy this is causing,
perhaps we should just move on and just forget the whole thing.  If I
have to I will patch the HC code in my own tree.  For now, I will submit
a few patches to clean up the locking on the io_bus.  That may help
narrow the gap without all this stuff, anyway.

-Greg




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 266 bytes --]

  reply	other threads:[~2009-05-08 20:00 UTC|newest]

Thread overview: 115+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-05 13:24 [RFC PATCH 0/3] generic hypercall support Gregory Haskins
2009-05-05 13:24 ` [RFC PATCH 1/3] add " Gregory Haskins
2009-05-05 17:03   ` Hollis Blanchard
2009-05-06 13:52   ` Anthony Liguori
2009-05-06 15:16     ` Gregory Haskins
2009-05-06 16:52       ` Arnd Bergmann
2009-05-05 13:24 ` [RFC PATCH 2/3] x86: " Gregory Haskins
2009-05-05 13:24 ` [RFC PATCH 3/3] kvm: add pv_cpu_ops.hypercall support to the guest Gregory Haskins
2009-05-05 13:36 ` [RFC PATCH 0/3] generic hypercall support Avi Kivity
2009-05-05 13:40   ` Gregory Haskins
2009-05-05 14:00     ` Avi Kivity
2009-05-05 14:14       ` Gregory Haskins
2009-05-05 14:21         ` Gregory Haskins
2009-05-05 15:02         ` Avi Kivity
2009-05-05 23:17         ` Chris Wright
2009-05-06  3:51           ` Gregory Haskins
2009-05-06  7:22             ` Chris Wright
2009-05-06 13:17               ` Gregory Haskins
2009-05-06 16:07                 ` Chris Wright
2009-05-07 17:03                   ` Gregory Haskins
2009-05-07 18:05                     ` Avi Kivity
2009-05-07 18:08                       ` Gregory Haskins
2009-05-07 18:12                         ` Avi Kivity
2009-05-07 18:16                           ` Gregory Haskins
2009-05-07 18:24                             ` Avi Kivity
2009-05-07 18:37                               ` Gregory Haskins
2009-05-07 19:00                                 ` Avi Kivity
2009-05-07 19:05                                   ` Gregory Haskins
2009-05-07 19:43                                     ` Avi Kivity
2009-05-07 20:07                                       ` Gregory Haskins
2009-05-07 20:15                                         ` Avi Kivity
2009-05-07 20:26                                           ` Gregory Haskins
2009-05-08  8:35                                             ` Avi Kivity
2009-05-08 11:29                                               ` Gregory Haskins
2009-05-07 19:07                                   ` Chris Wright
2009-05-07 19:12                                     ` Gregory Haskins
2009-05-07 19:21                                       ` Chris Wright
2009-05-07 19:26                                         ` Avi Kivity
2009-05-07 19:44                                           ` Avi Kivity
2009-05-07 19:29                                         ` Gregory Haskins
2009-05-07 20:25                                           ` Chris Wright
2009-05-07 20:34                                             ` Gregory Haskins
2009-05-07 20:54                                           ` Arnd Bergmann
2009-05-07 21:13                                             ` Gregory Haskins
2009-05-07 21:57                                               ` Chris Wright
2009-05-07 22:11                                                 ` Arnd Bergmann
2009-05-08 22:33                                                   ` Benjamin Herrenschmidt
2009-05-11 13:01                                                     ` Arnd Bergmann
2009-05-11 13:04                                                       ` Gregory Haskins
2009-05-07 20:00                             ` Arnd Bergmann
2009-05-07 20:31                               ` Gregory Haskins
2009-05-07 20:42                                 ` Arnd Bergmann
2009-05-07 20:47                                   ` Arnd Bergmann
2009-05-07 20:50                                 ` Chris Wright
2009-05-07 23:35                     ` Marcelo Tosatti
2009-05-07 23:43                       ` Marcelo Tosatti
2009-05-08  3:17                         ` Gregory Haskins
2009-05-08  7:55                         ` Avi Kivity
     [not found]                           ` <20090508103253.GC3011@amt.cnet>
2009-05-08 11:37                             ` Avi Kivity
2009-05-08 14:35                           ` Marcelo Tosatti
2009-05-08 14:45                             ` Gregory Haskins
2009-05-08 15:51                               ` Marcelo Tosatti
2009-05-08 19:56                                 ` David S. Ahern
2009-05-08 20:01                                   ` Gregory Haskins
2009-05-08 23:23                                     ` David S. Ahern
2009-05-09  8:45                                       ` Avi Kivity
2009-05-09 11:27                                         ` Gregory Haskins
2009-05-10  4:27                                           ` David S. Ahern
2009-05-10  5:24                                             ` Avi Kivity
2009-05-10  4:24                                         ` David S. Ahern
2009-05-08  3:13                       ` Gregory Haskins
2009-05-08  7:59                       ` Avi Kivity
2009-05-08 11:09                         ` Gregory Haskins
     [not found]                         ` <20090508104228.GD3011@amt.cnet>
2009-05-08 12:43                           ` Gregory Haskins
2009-05-08 15:33                             ` Marcelo Tosatti
2009-05-08 19:02                               ` Avi Kivity
2009-05-08 16:48                             ` Paul E. McKenney
2009-05-08 19:55                               ` Gregory Haskins
2009-05-08 14:15                       ` Gregory Haskins
2009-05-08 14:53                         ` Anthony Liguori
2009-05-08 18:50                           ` Avi Kivity
2009-05-08 19:02                             ` Anthony Liguori
2009-05-08 19:06                               ` Avi Kivity
2009-05-11 16:37                               ` Jeremy Fitzhardinge
2009-05-07 12:29                 ` Avi Kivity
2009-05-08 14:59                   ` Anthony Liguori
2009-05-09 12:01                     ` Gregory Haskins
2009-05-10 18:38                       ` Anthony Liguori
2009-05-11 13:14                         ` Gregory Haskins
2009-05-11 16:35                           ` Hollis Blanchard
2009-05-11 17:06                             ` Avi Kivity
2009-05-11 17:29                               ` Gregory Haskins
2009-05-11 17:53                                 ` Avi Kivity
2009-05-11 17:51                               ` Anthony Liguori
2009-05-11 18:02                                 ` Avi Kivity
2009-05-11 18:18                                   ` Anthony Liguori
2009-05-11 17:31                           ` Anthony Liguori
2009-05-13 10:53                             ` Gregory Haskins
2009-05-13 14:45                             ` Gregory Haskins
2009-05-11 16:44                         ` Hollis Blanchard
2009-05-11 17:54                           ` Anthony Liguori
2009-05-11 19:24                             ` PowerPC page faults Hollis Blanchard
2009-05-11 22:17                               ` Anthony Liguori
2009-05-12  5:46                                 ` Liu Yu-B13201
2009-05-12 14:50                                 ` Hollis Blanchard
2009-05-06 13:56             ` [RFC PATCH 0/3] generic hypercall support Anthony Liguori
2009-05-06 16:03               ` Gregory Haskins
2009-05-08  8:17                 ` Avi Kivity
2009-05-08 15:20                   ` Gregory Haskins
2009-05-08 17:00                     ` Avi Kivity
2009-05-08 18:55                       ` Gregory Haskins
2009-05-08 19:05                         ` Anthony Liguori
2009-05-08 19:12                         ` Avi Kivity
2009-05-08 19:59                           ` Gregory Haskins [this message]
2009-05-10  9:59                             ` Avi Kivity

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=4A048F2E.3080702@novell.com \
    --to=ghaskins@novell.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=gregory.haskins@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.