On 1/28/19 3:22 AM, Wanpeng Li wrote:
On Sun, 27 Jan 2019 at 18:19, Nir Weiner <nir.weiner@xxxxxxxxxx> wrote:
grow_halt_poll_ns() sets the halt_poll_ns value for a vCPU when
growing - It has
significant effect on how vCPU performs. On the standard case,
higher value is
better - we will spend more time in the polling busyloop, handle
events & interrupts faster and result in better performance for the VM.
But on outliers it puts us in a busy loop that does nothing.
grow_halt_poll_ns() optimal algorithm changes between different
workloads.
The changes in this patch series fixes 2 weird behaviors and exposes
hard-coded
value which stands for the initial grow value in order to get a better
fine-tunning control. See the individual patches for more details.
Please also post the performance number for your improvement.
Regards,
Wanpeng Li
Patches 1,3 fixes weird behaviors - performance is not related to them
as for patch 2 - I don't think that performance test is important here
as well because it is very different between different workloads.
halt_poll_ns_grow_start clearly have an impact.
Anyway, in order to show the impact it might have on a workload I have
created a random kvm workload with a qemu guest running ubuntu
attached to an ide-cd device. The first result has the value of 30000
in halt_poll_ns_grow_start. The second has the value of 60000.
On HOST:
root@host:/home/ubuntu# echo 30000 >
/sys/module/kvm/parameters/halt_poll_ns_grow_start
On GUEST:
root@guest:/home/ubuntu# for i in {0..10}; do dd if=temp of=temp2
bs=4k count=30k oflag=direct; done
73531392 bytes (74 MB) copied, 6.06007 s, 12.1 MB/s
73531392 bytes (74 MB) copied, 6.0312 s, 12.2 MB/s
73531392 bytes (74 MB) copied, 5.85135 s, 12.6 MB/s
73531392 bytes (74 MB) copied, 6.25177 s, 11.8 MB/s
73531392 bytes (74 MB) copied, 5.95527 s, 12.3 MB/s
73531392 bytes (74 MB) copied, 8.05464 s, 9.1 MB/s
73531392 bytes (74 MB) copied, 5.9278 s, 12.4 MB/s
73531392 bytes (74 MB) copied, 5.94568 s, 12.4 MB/s
73531392 bytes (74 MB) copied, 6.14417 s, 12.0 MB/s
73531392 bytes (74 MB) copied, 5.6248 s, 13.1 MB/s
73531392 bytes (74 MB) copied, 7.2072 s, 10.2 MB/s
on HOST:
root@host:/home/ubuntu# echo 60000 >
/sys/module/kvm/parameters/halt_poll_ns_grow_start
on GUEST:
root@guest:/home/ubuntu# for i in {0..10}; do dd if=temp of=temp2
bs=4k count=30k oflag=direct; done
73531392 bytes (74 MB) copied, 5.40449 s, 13.6 MB/s
73531392 bytes (74 MB) copied, 5.26436 s, 14.0 MB/s
73531392 bytes (74 MB) copied, 5.21524 s, 14.1 MB/s
73531392 bytes (74 MB) copied, 7.6195 s, 9.7 MB/s
73531392 bytes (74 MB) copied, 5.10807 s, 14.4 MB/s
73531392 bytes (74 MB) copied, 4.69817 s, 15.7 MB/s
73531392 bytes (74 MB) copied, 7.21698 s, 10.2 MB/s
73531392 bytes (74 MB) copied, 4.98453 s, 14.8 MB/s
73531392 bytes (74 MB) copied, 5.13896 s, 14.3 MB/s
73531392 bytes (74 MB) copied, 4.94555 s, 14.9 MB/s
73531392 bytes (74 MB) copied, 4.99381 s, 14.7 MB/s