Re: [PATCH] kvm tools: Add MMIO coalescing support

Ingo Molnar
2011-06-04T10:17:21Z

* Sasha Levin <levinsasha928@gmail.com> wrote:

> On Sat, 2011-06-04 at 11:38 +0200, Ingo Molnar wrote:
> > * Sasha Levin <levinsasha928@gmail.com> wrote:
> >
> > > Coalescing MMIO allows us to avoid an exit every time we have a
> > > MMIO write, instead - MMIO writes are coalesced in a ring which
> > > can be flushed once an exit for a different reason is needed.
> > > A MMIO exit is also trigged once the ring is full.
> > >
> > > Coalesce all MMIO regions registered in the MMIO mapper.
> > > Add a coalescing handler under kvm_cpu.
> >
> > Does this have any effect on latency? I.e. does the guest side
> > guarantee that the pending queue will be flushed after a group of
> > updates have been done?
>
> Theres nothing that detects groups of MMIO writes, but the ring size is
> a bit less than PAGE_SIZE (half of it is overhead - rest is data) and
> we'll exit once the ring is full.

But if the page is only filled partially and if mmio is not submitted
by the guest indefinitely (say it runs a lot of user-space code) then
the mmio remains pending in the partial-page buffer?

If that's how it works then i *really* don't like this, this looks
like a seriously mis-designed batching feature which might have
improved a few server benchmarks but which will introduce random,
hard to debug delays all around the place!

Thanks,

Ingo