]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: X86: trigger kvmclock sync request just once on VM creation
authorWanpeng Li <wanpengli@tencent.com>
Fri, 28 Feb 2020 03:18:41 +0000 (11:18 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 16:57:40 +0000 (17:57 +0100)
commitfce9db682aefce371eb5d14fcc752f06dc710e46
tree1b6cc541608c178f2f3c9ca9ad1107c4cea3e288
parent028e365a0d7f0d9393a3d974e2d3e7567e8b4aeb
KVM: X86: trigger kvmclock sync request just once on VM creation

In the progress of vCPUs creation, it queues a kvmclock sync worker to the global
workqueue before each vCPU creation completes. The workqueue subsystem guarantees
not to queue the already queued work; however, we can make the logic more clear by
making just one leader to trigger this kvmclock sync request, and also save on
cacheline bouncing caused by test_and_set_bit.

Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c