[BUG] Time accounting in KVM host

From: Yun Wang
Date: Sun Feb 15 2015 - 13:45:28 EST

Time accounting for KVM guests running mixed IO and CPU workloads seems wrong.

KVM host: CentOS 6, x86_64, Linux 3.14.33
KVM guest: CentOS 6, x86_64, Linux 3.14.33, one vCPU.

Both guest and host enabled CONFIG_IRQ_TIME_ACCOUNTING and

The KVM guest was running iperf network workload and a CPU-bound loop workload.
On the host, the KVM guest and four while(1) loops were consolidated
to one physical CPU. Top command in the host showed 20% CPU
utilization for the KVM guest and each loop process. However, the time
accounting was apparently wrong as the iperf performance in the KVM
guest was just slightly lower than its peak throughput when it ran on
a dedicated physical CPU. I expected the throughput to be
"proportional" or at least much lower than its peak as only 20% CPU
was allocated to the KVM guest. The performance of co-running loops
did see significant drops.

The KVM guest and loops were put in the same cgroup with same shares.
The problem seems to be that the IO process inside the KVM guest
silently eats up CPU cycles that are accounted to CPU-bound processes
outside of the KVM guest. This seems to be a serious fairness or
security concern between consolidated workloads.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/