[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v7 07/11] pvqspinlock, x86: Allow unfair queue spinlock in a XEN guest
- To: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
- From: Waiman Long <waiman.long@xxxxxx>
- Date: Thu, 20 Mar 2014 23:40:08 -0400
- Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Raghavendra K T <raghavendra.kt@xxxxxxxxxxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, Andi Kleen <andi@xxxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Michel Lespinasse <walken@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, linux-arch@xxxxxxxxxxxxxxx, Gleb Natapov <gleb@xxxxxxxxxx>, x86@xxxxxxxxxx, Ingo Molnar <mingo@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Scott J Norton <scott.norton@xxxxxx>, Rusty Russell <rusty@xxxxxxxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Chris Wright <chrisw@xxxxxxxxxxxx>, Oleg Nesterov <oleg@xxxxxxxxxx>, Alok Kataria <akataria@xxxxxxxxxx>, Aswin Chandramouleeswaran <aswin@xxxxxx>, Chegu Vinod <chegu_vinod@xxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, David Vrabel <david.vrabel@xxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 21 Mar 2014 03:40:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
On 03/19/2014 04:28 PM, Konrad Rzeszutek Wilk wrote:
On Wed, Mar 19, 2014 at 04:14:05PM -0400, Waiman Long wrote:
This patch adds a XEN init function to activate the unfair queue
spinlock in a XEN guest when the PARAVIRT_UNFAIR_LOCKS kernel config
option is selected.
Signed-off-by: Waiman Long<Waiman.Long@xxxxxx>
---
arch/x86/xen/setup.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 0982233..66bb6f5 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -625,3 +625,22 @@ void __init xen_arch_setup(void)
numa_off = 1;
#endif
}
+
+#ifdef CONFIG_PARAVIRT_UNFAIR_LOCKS
+/*
+ * Enable unfair lock if running in a Xen guest
+ */
+static __init int xen_unfair_locks_init_jump(void)
+{
+ /*
+ * Disable unfair lock if not running in a PV domain
+ */
+ if (!xen_pv_domain())
+ return 0;
I would just make this 'xen_domain'. Not sure why you need
to have it only for PV while the PVHVM guests can also use it?
The compilation of the setup.c file should have implied xen_domain
already (at least HVM). The check is added to make sure that unfair lock
won't be enabled on bare metal. As for PVHVM, is there a way to detect
it is running as such which is distinct from HVM?
Would it also make sense to use the same printk statement
that the KVM has?
Yes, I can add a printk statement like KVM.
-Longman
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|