qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH][RFC] Split non-TCG bits out of exec.c


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH][RFC] Split non-TCG bits out of exec.c
Date: Fri, 14 Nov 2008 08:07:32 -0600
User-agent: Thunderbird 2.0.0.17 (X11/20080925)

Jamie Lokier wrote:
Also, an earlier thread pointed out that loops doing a lot of MMIO are
_slower_ with KVM than without - this manifested as very slow VGA
output for some guests.  Having KVM pass control to TCG for short runs
of guest instructions which do MMIO, or other instructions which need
to be emulated, would accelerate KVM in this respect.

Note, the devil is in the details here.

An MMIO exit to userspace typically costs around 6k cycles. On the other hand, a TB translation tends to average closer to 300k often times reaching much higher. This with was with dyngen so TCG may be more or less expensive.

An in-kernel MMIO exit on the other hand will cost around 3k cycles. MMIO coalescing is pretty efficient because it effectively reduces the cost of a exit by half.

To make up the cost of TCG translation for just one TB, you need to have a tight loop of at least 50 iterations. We can handle rep instructions with a single exit in KVM so this needs to be an actual MMIO loop, not a rep loop.

If you also consider all the potential locking issues with SMP guests, I think it's pretty likely that there are few cases where dropping to TCG is going to be a net performance win.

Regards,

Anthony Liguori

-- Jamie
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to address@hidden
More majordomo info at  http://vger.kernel.org/majordomo-info.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]