]> xenbits.xensource.com Git - xen.git/commit
x86/time: update vtsc_last with cmpxchg and drop vtsc_lock
authorIgor Druzhinin <igor.druzhinin@citrix.com>
Fri, 20 Dec 2019 15:44:38 +0000 (16:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 20 Dec 2019 15:44:38 +0000 (16:44 +0100)
commitf9dee1f945ebb6fb5f9df6f5d95b15c25727f48e
treec08479104f8b243aa547b1f5af8d64c2d9ff9708
parent619a7119da6a57ffe8bdd0f382e011eef05fbec2
x86/time: update vtsc_last with cmpxchg and drop vtsc_lock

Now that vtsc_last is the only entity protected by vtsc_lock we can
simply update it using a single atomic operation and drop the spinlock
entirely. This is extremely important for the case of running nested
(e.g. shim instance with lots of vCPUs assigned) since if preemption
happens somewhere inside the critical section that would immediately
mean that other vCPU stop progressing (and probably being preempted
as well) waiting for the spinlock to be freed.

This fixes constant shim guest boot lockups with ~32 vCPUs if there is
vCPU overcommit present (which increases the likelihood of preemption).

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/time.c
xen/include/asm-x86/domain.h