aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-08-26 14:28:06 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-09-09 12:06:38 -0400
commit3310bbedac497b793b96184e1b9b5da4f747d53a (patch)
tree752ae55da27c5d4239591a0a1b5e5b0e1b9b8a73 /arch/x86
parent26a799952737de20626e8c5c51b24534f1c90536 (diff)
xen/spinlock: Don't setup xen spinlock IPI kicker if disabled.
There is no need to setup this kicker IPI if we are never going to use the paravirtualized ticketlock mechanism. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/xen/spinlock.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c
index 71db82ce08c6..e1bff87766be 100644
--- a/arch/x86/xen/spinlock.c
+++ b/arch/x86/xen/spinlock.c
@@ -105,6 +105,7 @@ static DEFINE_PER_CPU(char *, irq_name);
105static DEFINE_PER_CPU(struct xen_lock_waiting, lock_waiting); 105static DEFINE_PER_CPU(struct xen_lock_waiting, lock_waiting);
106static cpumask_t waiting_cpus; 106static cpumask_t waiting_cpus;
107 107
108static bool xen_pvspin __initdata = true;
108static void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want) 109static void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want)
109{ 110{
110 int irq = __this_cpu_read(lock_kicker_irq); 111 int irq = __this_cpu_read(lock_kicker_irq);
@@ -223,6 +224,9 @@ void xen_init_lock_cpu(int cpu)
223 int irq; 224 int irq;
224 char *name; 225 char *name;
225 226
227 if (!xen_pvspin)
228 return;
229
226 WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n", 230 WARN(per_cpu(lock_kicker_irq, cpu) >= 0, "spinlock on CPU%d exists on IRQ%d!\n",
227 cpu, per_cpu(lock_kicker_irq, cpu)); 231 cpu, per_cpu(lock_kicker_irq, cpu));
228 232
@@ -259,13 +263,15 @@ void xen_uninit_lock_cpu(int cpu)
259 if (xen_hvm_domain()) 263 if (xen_hvm_domain())
260 return; 264 return;
261 265
266 if (!xen_pvspin)
267 return;
268
262 unbind_from_irqhandler(per_cpu(lock_kicker_irq, cpu), NULL); 269 unbind_from_irqhandler(per_cpu(lock_kicker_irq, cpu), NULL);
263 per_cpu(lock_kicker_irq, cpu) = -1; 270 per_cpu(lock_kicker_irq, cpu) = -1;
264 kfree(per_cpu(irq_name, cpu)); 271 kfree(per_cpu(irq_name, cpu));
265 per_cpu(irq_name, cpu) = NULL; 272 per_cpu(irq_name, cpu) = NULL;
266} 273}
267 274
268static bool xen_pvspin __initdata = true;
269 275
270void __init xen_init_spinlocks(void) 276void __init xen_init_spinlocks(void)
271{ 277{
@@ -305,6 +311,9 @@ static int __init xen_spinlock_debugfs(void)
305 if (d_xen == NULL) 311 if (d_xen == NULL)
306 return -ENOMEM; 312 return -ENOMEM;
307 313
314 if (!xen_pvspin)
315 return 0;
316
308 d_spin_debug = debugfs_create_dir("spinlocks", d_xen); 317 d_spin_debug = debugfs_create_dir("spinlocks", d_xen);
309 318
310 debugfs_create_u8("zero_stats", 0644, d_spin_debug, &zero_stats); 319 debugfs_create_u8("zero_stats", 0644, d_spin_debug, &zero_stats);