On 23 January 2017 at 20:51, David Matlack <dmatlack@xxxxxxxxxx> wrote: > Hi Don. > > On Mon, Jan 23, 2017 at 4:35 PM, Don Bowman <db@xxxxxxxxxxxx> wrote: >> The below C program, run on my host, uses ~0% of the host CPU when run >> with 100000 (e.g. wake up every 100us). >> >> When run under kvm, this uses ~100% of the processor. The reason is there >> is a vmexit for every timer wakeup. > > This is probably halt-polling. When a vCPU halts, KVM will sometimes > spin until a virtual interrupt arrives to wake up the vCPU. This gives > better wake-up latency, but at the cost of CPU usage. The upside is > halt-polling only kicks in if the host CPU is otherwise idle. So it > doesn't steal runtime from other threads. > I am very grateful for your answer, this was hugely helpful. yes indeed this improved. I'll have to read and understand a bit more the tradeoff. But thanks very much!