From: Gregory Haskins <ghaskins@novell.com>
To: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Chris Wright <chrisw@sous-sol.org>,
Gregory Haskins <gregory.haskins@gmail.com>,
Avi Kivity <avi@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [RFC PATCH 0/3] generic hypercall support
Date: Thu, 07 May 2009 23:13:16 -0400 [thread overview]
Message-ID: <4A03A34C.3000109@novell.com> (raw)
In-Reply-To: <20090507233503.GA9103@amt.cnet>
[-- Attachment #1: Type: text/plain, Size: 4197 bytes --]
Marcelo Tosatti wrote:
> On Thu, May 07, 2009 at 01:03:45PM -0400, Gregory Haskins wrote:
>
>> Chris Wright wrote:
>>
>>> * Gregory Haskins (ghaskins@novell.com) wrote:
>>>
>>>
>>>> Chris Wright wrote:
>>>>
>>>>
>>>>> VF drivers can also have this issue (and typically use mmio).
>>>>> I at least have a better idea what your proposal is, thanks for
>>>>> explanation. Are you able to demonstrate concrete benefit with it yet
>>>>> (improved latency numbers for example)?
>>>>>
>>>>>
>>>> I had a test-harness/numbers for this kind of thing, but its a bit
>>>> crufty since its from ~1.5 years ago. I will dig it up, update it, and
>>>> generate/post new numbers.
>>>>
>>>>
>>> That would be useful, because I keep coming back to pio and shared
>>> page(s) when think of why not to do this. Seems I'm not alone in that.
>>>
>>> thanks,
>>> -chris
>>>
>>>
>> I completed the resurrection of the test and wrote up a little wiki on
>> the subject, which you can find here:
>>
>> http://developer.novell.com/wiki/index.php/WhyHypercalls
>>
>> Hopefully this answers Chris' "show me the numbers" and Anthony's "Why
>> reinvent the wheel?" questions.
>>
>> I will include this information when I publish the updated v2 series
>> with the s/hypercall/dynhc changes.
>>
>> Let me know if you have any questions.
>>
>
> Greg,
>
> I think comparison is not entirely fair. You're using
> KVM_HC_VAPIC_POLL_IRQ ("null" hypercall) and the compiler optimizes that
> (on Intel) to only one register read:
>
> nr = kvm_register_read(vcpu, VCPU_REGS_RAX);
>
> Whereas in a real hypercall for (say) PIO you would need the address,
> size, direction and data.
>
Hi Marcelo,
I'll have to respectfully disagree with you here. What you are
proposing is actually a different test: a 4th type I would call "PIO
over HC". It is distinctly different than the existing MMIO, PIO, and
HC tests already present.
I assert that the current HC test remains valid because for pure
hypercalls, the "nr" *is* the address. It identifies the function to be
executed (e.g. VAPIC_POLL_IRQ = null), just like the PIO address of my
nullio device identifies the function to be executed (i.e.
nullio_write() = null)
My argument is that the HC test emulates the "dynhc()" concept I have
been talking about, whereas the PIOoHC is more like the
pv_io_ops->iowrite approach.
That said, your 4th test type would actually be a very interesting
data-point to add to the suite (especially since we are still kicking
around the notion of doing something like this). I will update the
patches.
> Also for PIO/MMIO you're adding this unoptimized lookup to the
> measurement:
>
> pio_dev = vcpu_find_pio_dev(vcpu, port, size, !in);
> if (pio_dev) {
> kernel_pio(pio_dev, vcpu, vcpu->arch.pio_data);
> complete_pio(vcpu);
> return 1;
> }
>
> Whereas for hypercall measurement you don't.
In theory they should both share about the same algorithmic complexity
in the decode-stage, but due to the possible optimization you mention
you may have a point. I need to take some steps to ensure the HC path
isn't artificially simplified by GCC (like making the execute stage do
some trivial work like you mention below).
> I believe a fair comparison
> would be have a shared guest/host memory area where you store guest/host
> TSC values and then do, on guest:
>
> rdtscll(&shared_area->guest_tsc);
> pio/mmio/hypercall
> ... back to host
> rdtscll(&shared_area->host_tsc);
>
> And then calculate the difference (minus guests TSC_OFFSET of course)?
>
>
I'm not sure I need that much complexity. I can probably just change
the test harness to generate an ioread32(), and have the functions
return the TSC value as a return parameter for all test types. The
important thing is that we pick something extremely cheap (yet dynamic)
to compute so the execution time doesn't invalidate the measurement
granularity with a large constant.
Regards,
-Greg
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 266 bytes --]
next prev parent reply other threads:[~2009-05-08 3:13 UTC|newest]
Thread overview: 104+ 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 3:13 ` Gregory Haskins [this message]
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
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=4A03A34C.3000109@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 \
--cc=mtosatti@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