Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933196AbcKVMgF (ORCPT ); Tue, 22 Nov 2016 07:36:05 -0500 Received: from terminus.zytor.com ([198.137.202.10]:42230 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932816AbcKVMfu (ORCPT ); Tue, 22 Nov 2016 07:35:50 -0500 Date: Tue, 22 Nov 2016 04:35:13 -0800 From: tip-bot for Juergen Gross Message-ID: Cc: jgross@suse.com, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, xinhui.pan@linux.vnet.ibm.com, mingo@kernel.org, peterz@infradead.org, torvalds@linux-foundation.org Reply-To: xinhui.pan@linux.vnet.ibm.com, jgross@suse.com, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, peterz@infradead.org, torvalds@linux-foundation.org, mingo@kernel.org In-Reply-To: <1478077718-37424-11-git-send-email-xinhui.pan@linux.vnet.ibm.com> References: <1478077718-37424-11-git-send-email-xinhui.pan@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] x86/xen: Support the vCPU preemption check Git-Commit-ID: de7689cf8f3820b34088da3b22ce1a548dda2fc5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2457 Lines: 68 Commit-ID: de7689cf8f3820b34088da3b22ce1a548dda2fc5 Gitweb: http://git.kernel.org/tip/de7689cf8f3820b34088da3b22ce1a548dda2fc5 Author: Juergen Gross AuthorDate: Wed, 2 Nov 2016 05:08:37 -0400 Committer: Ingo Molnar CommitDate: Tue, 22 Nov 2016 12:48:09 +0100 x86/xen: Support the vCPU preemption check Support the vcpu_is_preempted() functionality under Xen. This will enhance lock performance on overcommitted hosts (more runnable vCPUs than physical CPUs in the system) as doing busy waits for preempted vCPUs will hurt system performance far worse than early yielding. A quick test (4 vCPUs on 1 physical CPU doing a parallel build job with "make -j 8") reduced system time by about 5% with this patch. Signed-off-by: Juergen Gross Signed-off-by: Pan Xinhui Signed-off-by: Peter Zijlstra (Intel) Cc: David.Laight@ACULAB.COM Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: benh@kernel.crashing.org Cc: boqun.feng@gmail.com Cc: borntraeger@de.ibm.com Cc: bsingharora@gmail.com Cc: dave@stgolabs.net Cc: kernellwp@gmail.com Cc: konrad.wilk@oracle.com Cc: linuxppc-dev@lists.ozlabs.org Cc: mpe@ellerman.id.au Cc: paulmck@linux.vnet.ibm.com Cc: paulus@samba.org Cc: pbonzini@redhat.com Cc: rkrcmar@redhat.com Cc: virtualization@lists.linux-foundation.org Cc: will.deacon@arm.com Cc: xen-devel-request@lists.xenproject.org Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/1478077718-37424-11-git-send-email-xinhui.pan@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- arch/x86/xen/spinlock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c index 3d6e006..74756bb 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c @@ -114,7 +114,6 @@ void xen_uninit_lock_cpu(int cpu) per_cpu(irq_name, cpu) = NULL; } - /* * Our init of PV spinlocks is split in two init functions due to us * using paravirt patching and jump labels patching and having to do @@ -137,6 +136,8 @@ void __init xen_init_spinlocks(void) pv_lock_ops.queued_spin_unlock = PV_CALLEE_SAVE(__pv_queued_spin_unlock); pv_lock_ops.wait = xen_qlock_wait; pv_lock_ops.kick = xen_qlock_kick; + + pv_lock_ops.vcpu_is_preempted = xen_vcpu_stolen; } /*