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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to