Re: [PATCH 5/6] kvm: qemu: virtio-net: handle all tx in I/O thread without timer

Avi Kivity
2008-11-06T17:43:15Z

Mark McLoughlin wrote:
> My machine has four CPUs, with two 6Mb L2 caches - each cache is shared
> between two of the CPUs, so I set things up as follows:
>
> pcpu#3 - netserver, I/O thread, vcpu#0
> pcup#4 - vcpu#1, virtio_net irq, netperf
>
> which (hopefully) ensures that we're only doing one copy using RAM and
> the rest are using the L1/L2 caches.
>

This pinning can drastically alter the results in other ways. If the
vcpu doing the transmit and the iothread can run in parallel, each
guest->host kick will result in a vmexit, IPI, and iothread execution,
with much less blocking of interrupts.

When the iothread and vcpu are collocated, the scheduler will ensure
natural batching and you will only vmexit when the ring is full (or
empty, in the case of the iothread), or if you spent quite a long time
processing it.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.