xen/spinlock: Don't use pvqspinlock if only 1 vCPU
authorWaiman Long <longman@redhat.com>
Thu, 19 Jul 2018 21:39:57 +0000 (17:39 -0400)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Fri, 27 Jul 2018 03:05:14 +0000 (23:05 -0400)
commit47b428d14f06dbeab23dd5c7e424e15283841765
tree2305cea8afb27ae05e804c8c8af1e9d394e2a6bf
parentbf8dc55b135873d8bc58bb8fbc91c52f3a902eea
xen/spinlock: Don't use pvqspinlock if only 1 vCPU

On a VM with only 1 vCPU, the locking fast paths will always be
successful. In this case, there is no need to use the the PV qspinlock
code which has higher overhead on the unlock side than the native
qspinlock code.

The xen_pvspin veriable is also turned off in this 1 vCPU case to
eliminate unneeded pvqspinlock initialization in xen_init_lock_cpu()
which is run after xen_init_spinlocks().

Signed-off-by: Waiman Long <longman@redhat.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
arch/x86/xen/spinlock.c